Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.unix.xenix.sco Subject: Re: Mtools is great - get rid of doscp! (location) Message-ID: <3485@crdos1.crd.ge.COM> Date: 26 Jun 91 18:05:05 GMT References: <705@genco.bungi.com> <1991Jun23.043224.22182@world.std.com> <710@genco.bungi.com> Reply-To: davidsen@crdos1.crd.ge.com (bill davidsen) Organization: GE Corp R&D Center, Schenectady NY Lines: 69 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 == "