Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site sdcsla.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!sdcsla!west From: west@sdcsla.UUCP (Larry West) Newsgroups: net.unix-wizards Subject: Re: more on csh quirks Message-ID: <834@sdcsla.UUCP> Date: Sat, 13-Apr-85 02:33:10 EST Article-I.D.: sdcsla.834 Posted: Sat Apr 13 02:33:10 1985 Date-Received: Sun, 14-Apr-85 03:47:48 EST References: <9845@brl-tgr.ARPA> Reply-To: west@sdcsla.UUCP (Larry West) Organization: UC San Diego: Institute for Cognitive Science Lines: 28 Summary: Hardly worth calling a quirk, Captain In article <9845@brl-tgr.ARPA> argv@ucb-vax.ARPA writes: > >set foo = $< > >if the user types "foo bar" then > >if($foo == "something") etc.. > >will die with an "expression syntax" because of the space. >I thought, perhaps, that if the shell parsed the "foo" and >"bar" into two separate tokens, I should be able to access >$foo[0] and $foo[1] and get "foo" and "bar" respectively. >This also is not the case. All you need to do is: set foo = $< set foo = ( $foo ) the latter expands the string into separate words. For comparisions of strings, try: if ( "X$foo" == "Xsomething" ) et cetera... -- Larry West Institute for Cognitive Science (USA+619-)452-6220 UC San Diego (mailcode C-015) [x6220] ARPA: La Jolla, CA 92093 U.S.A. UUCP: {ucbvax,sdcrdcf,decvax,ihnp4}!sdcsvax!sdcsla!west OR ulysses!sdcsla!west