Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.7.0.8 $; site cdp Path: utzoo!watmath!clyde!burl!ulysses!allegra!oliveb!Glacier!cdp!david From: david@cdp.UUCP Newsgroups: net.unix Subject: Re: a Make question Message-ID: <2800002@cdp> Date: Sat, 30-Nov-85 00:00:00 EST Article-I.D.: cdp.2800002 Posted: Sat Nov 30 00:00:00 1985 Date-Received: Sat, 2-Nov-85 07:02:07 EST References: <1596@uwmacc.UUCP> Lines: 22 Nf-ID: #R:uwmacc.UUCP:-159600:cdp:2800002:000:729 Nf-From: cdp.UUCP!david Nov 29 21:00:00 1985 > > DIRS = d1 d2 d3 d4 d5 > depend: ; (for dir in $(DIRS); do (cd $dir; make depend); done) > >The problem with this is that 'make' is interpreting the $d as a null >string, so the 'cd' command sees an argument of "ir". I tried >escaping the $ preceding dir, to no avail. Can anybody make the >above loop work, or suggest a better way? Thanks! # add the following line to insure that the bourne is called # called as the shell (make in many incarnations # reads the users environment). SHELL=/bin/sh depend: ; (for dir in $(DIRS); do (cd $$dir; make depend); done) ^ # to get a literal $ past make one must escape it with another $. david stone !{hplabs,glacier}!cdp!david