File: cdadd

package info (click to toggle)
cdtool 2.1.5-13
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 316 kB
  • ctags: 185
  • sloc: ansic: 2,375; makefile: 181; sh: 134
file content (29 lines) | stat: -rwxr-xr-x 489 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
# "cdadd" copyright 1994 thomas insel
#         copyright 1996 sven oliver moll
usage()
{
  echo >&2 Usage: `basename $0` [-[0-7]]
  echo >&2 This program is part of cdtool. See \"man cdtool\" for more info.
  exit 1
}

case $# in
  [01]) ;;
  *) usage;;
esac

case x$1 in
  x-[0-7]) DRIVE=$1;;
  x) ;;
  *) usage;;
esac

/usr/local/bin/cdir $DRIVE -t > /tmp/cdadd-$$

if [ -z $EDITOR ]; then
  EDITOR=vi
fi
$EDITOR /tmp/cdadd-$$
cat /tmp/cdadd-$$ >>~/.cdtooldb
rm /tmp/cdadd-$$