Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!steinmetz!davidsen From: davidsen@steinmetz.steinmetz.UUCP (William E. Davidsen Jr) Newsgroups: comp.unix.xenix Subject: Another DOS directory utility Message-ID: <7265@steinmetz.steinmetz.UUCP> Date: Tue, 8-Sep-87 14:20:45 EDT Article-I.D.: steinmet.7265 Posted: Tue Sep 8 14:20:45 1987 Date-Received: Wed, 9-Sep-87 07:17:52 EDT Organization: GE Corp. R & D, Schenectady,NY Lines: 61 Keywords: DOS, directory Since I posted my everyday DOS directory lister, I thought this one might be of use. It will list an entire DOS disk including all subdirectories. It does no fancy formatting, but will produce a multicolumn listing if you want to send the output to a w-i-d-e printer. ---------------- cut here ---------------- : #!/bin/sh # # rdosdir - recursive DOS directory for XENIX # # Author: Bill Davidsen, 12-11-86 # # Arguments: # 1 - disk and directory # 2 - columns of output (opt) # 3 - print colums (opt) # see if user needs help if [ $# -eq 0 -o "$1" = "-h" ] then # output help and quit echo "\n\n$0: command format, options in [brackets]" echo " $0 StartDir [print cols] [print width]" echo "\nExample:" echo " $0 a: 2 90" echo "print all directories on disk A:, double column" echo "page width of 90 columns" exit 0 fi # see if print coulmns specified if [ -n "$3" ] then width=w$3 fi # process the current directory temp=/tmp/dd.$$ # temp file name dosdir $1 | sort >$temp echo "\n$1\n" pr -${2}${width}t $temp # build a list of subdirectories subdir=`awk ' { if ($3 == "") print $1 "." $2; if ($2 == "" && substr($1,1,1) != ".") print $1 }' $temp` for dirname in $subdir do $0 $1/$dirname $2 $3 done # clean up rm $temp ---------------- end ---------------- -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me