Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!sample.eng.ohio-state.edu!purdue!haven.umd.edu!udel!princeton!phoenix.Princeton.EDU!tty!keyboard!subbarao!kartik From: subbarao@phoenix.Princeton.EDU (Kartik Subbarao) Newsgroups: comp.unix.shell Subject: Re: csh setenv with `cat ...` Message-ID: Date: 26 Apr 91 14:59:26 GMT References: <6291@beryl12.UUCP> <56092@notavax.Princeton.EDU> Sender: news@idunno.Princeton.EDU Reply-To: subbarao@phoenix.Princeton.EDU (Kartik Subbarao) Distribution: comp Lines: 44 In article <56092@notavax.Princeton.EDU> writes: >mostek@motcid.UUCP (Frank B. Mostek) wrote: >>I am having a problem with the csh setenv command: >> >>$setenv EXINIT `cat ~/.myexrc` >>`cat ~/.myexrc`: Ambiguous. > >The problem is that `cat ~/.myexrc` produces more than one word. setenv >takes only two arguments. Do: > >setenv EXINIT "`cat ~/.myexrc`" > >The double quotes prevent the `...` from being split into words. > Unfortunately, this doesn't work in csh (like it does in another unmentioned shell :-) ). You can do this, but it depends upon the format of your .exrc: % setenv EXINIT "`tr -d \\012 < ~/.ex`" Since you can't quote newlines in csh (apparently). Your .exrc should not have multiple set statements, because the whole .exrc has to be slurped in as one line. I don't know about putting comments in either; they may screw things up. But anyway, you said that the reason that you used this setenv approach is because the .exrc got executed twice? Are you sure? I have a .exrc in my home directory and it never gets executed twice when I vi stuff (e.g, this ~/.article file I'm editing now). You might want to tell us your setup so that there might be an easier way to do this. -Kartik -- internet# rm `df | tail +2 | awk '{ printf "%s/quotas\n",$6}'` subbarao@phoenix.Princeton.EDU -| Internet kartik@silvertone.Princeton.EDU (NeXT mail) SUBBARAO@PUCC.BITNET - Bitnet