Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site investor.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!rochester!cmu-cs-pt!cadre!pitt!darth!investor!rbp From: rbp@investor.UUCP (Bob Peirce) Newsgroups: net.sources Subject: Re: "nmkdir" in the Bourne shell at a Unix machine near you. Message-ID: <233@investor.UUCP> Date: Mon, 2-Sep-85 11:45:23 EDT Article-I.D.: investor.233 Posted: Mon Sep 2 11:45:23 1985 Date-Received: Wed, 4-Sep-85 06:25:06 EDT Organization: Cookson, Peirce & Co., Pittsburgh, PA Lines: 30 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