Mtools is great - get rid of doscp! (location)
Wm E Davidsen Jr
davidsen at crdos1.crd.ge.COM
Thu Jun 27 04:05:05 AEST 1991
Since there's all this interest in mtools, here's a little script to
list *all* files on a disk, recursively.
#!/bin/sh
# shar: Shell Archiver (v1.29)
#
# Run the following text with /bin/sh to create:
# mrdir
#
echo "x - extracting mrdir (Text)"
sed 's/^X//' << 'SHAR_EOF' > mrdir &&
X:
X#!/bin/sh
X#
X# rdosdir - recursive DOS directory for mtools
X#
X# Author: Bill Davidsen, 12-11-86
X# converted to mtools 6-14-91
X#
X# Arguments:
X# 1 - disk and directory
X# 2 - columns of output (opt)
X# 3 - print colums (opt)
X
X# see if user needs help
Xif [ $# -eq 0 -o "$1" = "-h" ]
Xthen # output help and quit
X echo "\n\n$0: command format, options in [brackets]"
X echo " $0 StartDir [print cols] [print width]"
X echo "\nExample:"
X echo " $0 a: 2 90"
X echo "print all directories on disk A:, double column"
X echo "page width of 90 columns"
X exit 0
Xfi
X
X# see if print columns specified
Xif [ -n "$3" ]
Xthen
X width=w$3
Xfi
X
X# process the current directory
Xtemp=/tmp/dd.$$ # temp file name
Xmdir $1 | sort >$temp
Xecho "\n$1\n"
Xpr -${2}${width}t $temp
X
X# build a list of subdirectories
Xsubdir=`awk '
X{ if ($3 == "<DIR>") print $1 "." $2;
X if ($2 == "<DIR>" && substr($1,1,1) != ".") print $1
X}' $temp`
X
Xfor dirname in $subdir
Xdo
X $0 $1/$dirname $2 $3
Xdone
X
X# clean up
Xrm $temp
SHAR_EOF
chmod 0755 mrdir || echo "restore of mrdir fails"
exit 0
--
bill davidsen (davidsen at crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
GE Corp R&D Center, Information Systems Operation, tech support group
Moderator comp.binaries.ibm.pc and 386-users digest.
More information about the Comp.unix.xenix.sco
mailing list