Path: utzoo!attcan!uunet!samsung!sol.ctr.columbia.edu!cica!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!eru!luth!sunic!mcsun!hp4nl!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.wizards Subject: Re: csh programming problem Message-ID: <5991@star.cs.vu.nl> Date: 15 Mar 90 16:10:58 GMT References: <53408@bbn.COM> <1990Mar15.102758.17051@axion.bt.co.uk> Sender: news@cs.vu.nl Reply-To: maart@cs.vu.nl (Maarten Litmaath) Organization: VU Informatika, Amsterdam, the Netherlands Lines: 42 In article <1990Mar15.102758.17051@axion.bt.co.uk>, iwarner@axion.bt.co.uk (Ivan Warner) writes: )In article <53408@bbn.COM>, ellard@bbn.com (Dan Ellard) writes: )> I am trying to write a shell script that takes several arguments and )> passes them to child processes, i.e. )> )> #!/bin/csh )> foo $1 $2 ... )> bar $1 $2 ... )... )> Unfortunately, this method does not work when $1 is something like 'a )b', [...] )... ) what on earth is wrong with: ) )#!/bin/csh )foo "$1" "$2" )bar "$1" "$2" ) ) have I missed some subtle point, or is this not a `wizards' question You missed a subtle point: what if the number of arguments is unknown in advance? You can't say "$@" in csh. Still this isn't a wizards question, because the answer can be found in the csh manual: % set argv=('a b' \\c \') % set argv=($argv:q pp) % cat aap for i do echo "=$i=" done % sh aap $*:q =a b= =\c= ='= =pp= % -- 1) Will 4.5BSD have wait5()? |Maarten Litmaath @ VU Amsterdam: 2) Sleep(3) should be sleep(2) again.|maart@cs.vu.nl, uunet!mcsun!botter!maart