csh setenv with `cat ...`

Gary Weimer 253-7796 weimer at garden.ssd.kodak.com
Sat Apr 27 05:05:50 AEST 1991


In article <6291 at beryl12.UUCP>, mostek at 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 '<program>' ~/.myexrc`" would be nice, but I
couldn't get it to work; hence the intermediate set x=(...)

weimer at ssd.kodak.com ( Gary Weimer )



More information about the Comp.unix.shell mailing list