"nmkdir" in the Bourne shell at a Unix machine near you.

Bob Peirce rbp at investor.UUCP
Tue Sep 3 01:45:23 AEST 1985


In order to keep things on disk that need to be accessed from time-to-
time but never need changed, we created a parallel directory tree to
which to move such files.  These are backed up once a week or so rather
than every night.  To build the files we had to make directories on the
fly and used the following approach:

	if [ ! -d $H$D ]	#  directory doesn't exist
	then
		#  make required directories
		L=`echo $H$D | tr "/" ' '`
		I=""
		for i in $L
		do
			I=$I/$i
			if [ ! -d $I ]
			then
				mkdir $I
			fi
		done
	fi

$H$D is the path, ex the file name.
-- 

		 	Bob Peirce, Pittsburgh, PA
		uucp: ...!{allegra, bellcore, cadre, idis}
		  	 !pitt!darth!investor!rbp
				412-471-5320

		NOTE:  Mail must be < 30K  bytes/message



More information about the Comp.sources.unix mailing list