Newsgroups: comp.unix.shell Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!cornell!rochester!kodak!ispd-newsserver!garden.ssd.kodak.com!weimer From: weimer@garden.ssd.kodak.com (Gary Weimer (253-7796)) Subject: Re: csh setenv with `cat ...` Message-ID: <1991Apr26.190550.15843@ssd.kodak.com> Keywords: csh setenv with `cat ...` Sender: news@ssd.kodak.com Reply-To: weimer@ssd.kodak.com Organization: Eastman Kodak Co.; Rochester, NY References: <6291@beryl12.UUCP> Distribution: comp Date: Fri, 26 Apr 91 19:05:50 GMT In article <6291@beryl12.UUCP>, mostek@motcid.UUCP (Frank B. Mostek) writes: |> I am having a problem with the csh setenv command: |> |> $setenv EXINIT `cat ~/.myexrc` |> `cat ~/.myexrc`: Ambiguous. |> |> Any ideas? who about: set x=(`awk '{if(substr($1,1,1)=="\"")next}{if(s==""){s=$0}else{s=s"|"$0}}END{print s}' ~/.myexrc`) setenv EXINIT "$x" This makes the necessary formatting changes, skipping comments (awk script) and gets rid of Ambiguous error (`cat ~/.myexrc` produces multiple "words", setenv interprets them as multiple params and gags). NOTE: setenv EXINIT "`awk '' ~/.myexrc`" would be nice, but I couldn't get it to work; hence the intermediate set x=(...) weimer@ssd.kodak.com ( Gary Weimer )