home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
ddjmag
/
ddj8706.arc
/
BBS.L2
< prev
next >
Wrap
Text File
|
1987-05-05
|
2KB
|
85 lines
Listing Two
dwnld
# identify which file directory (contained in the first argument - $1)
1 if [ "$1" = MS ]
2 then
# an MS-DOS file
3 filedir=/u/bbs/MS-files
4 elif [ "$1" = Mac ]
5 then
# a Macintosh file
6 filedir=/u/bbs/Mac-files
7 elif [ "$1" = Unix ]
8 then
# a Unix file
9 filedir=/u/bbs/Unix-files
10 else
# no valid file directory was entered
11 echo "Follow the dwnld command with a file directory - MS, Mac, or Unix"
12 fi
# verify that a file name has been entered (contained in the second argument - $2)
13 if [ -n "$2" ]
14 then
# verify that the file name exists within the selected directory
15 if [ -f "$filedir/$2" ]
16 then
17 echo 'who am i | cut -f1 -d" " ' 'date | cut -c1-16 ' "dwnld" $1 $2 >>/u/bbs/log.file
# select a file transfer protocol
18 echo "Transfer potocol (X = Xmodem; A = ASCII): \c"
19 read method
20 if [ "$method" = X -o "$method" = x ]
21 then
# send a binary file using the XModem protocol
22 xmodem -sb $filedir/$2
23 else
# send an ASCII file
24 echo "Prepare to transfer file. Press return to start."
25 read dummy
26 cat $filedir/$2
27 sleep 5
28 echo "Download complete. Press return to continue."
29 read dummy
30 fi
31 else
# a valid file name wasn't entered
32 echo "Sorry, that file name does not exist. Be sure to type the"
33 echo "file name exactly as it appears in the directory listing."
34 echo "Upper and lower case letters are different."
35 fi
36 else
# no file name was entered
37 echo "Please enter a file name after the directory on the command line."
38 echo "Use the list command to see available file names."
39 fi