Path: utzoo!mnetor!uunet!steinmetz!davidsen From: davidsen@steinmetz.steinmetz.UUCP (William E. Davidsen Jr) Newsgroups: comp.unix.xenix Subject: Getting DOS directories under Xenix Message-ID: <9606@steinmetz.steinmetz.UUCP> Date: 18 Feb 88 22:28:58 GMT Organization: GE Corp. R & D, Schenectady,NY Lines: 71 Keywords: directory, DOS Here's a little shell script which produces a complete directory of a DOS disk, including all of the subdirectories of the starting directory. It runs quite slowly, but is much better than doing it by hand. : #!/bin/sh # shar+ created from directory /usr2/davidsen/bin # 17:25 on Thu Feb 18, 1988 by davidsen echo 'x - rdosdir (text)' sed << 'E!O!F' 's/^X//' > rdosdir X: X#!/bin/sh X# X# rdosdir - recursive DOS directory for XENIX X# X# Author: Bill Davidsen, 12-11-86 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 coulmns specified Xif [ -n "$3" ] Xthen X width=w$3 Xfi X X# process the current directory Xtemp=/tmp/dd.$$ # temp file name Xdosdir $1 | sort >$temp Xecho "\n$1\n" Xpr -${2}${width}t $temp X X# build a list of subdirectories Xsubdir=`awk ' X{ if ($3 == "