Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ncr-sd.UUCP Path: utzoo!watmath!clyde!cbosgd!ncr-sd!greg From: greg@ncr-sd.UUCP (Greg Noel) Newsgroups: net.unix-wizards,net.bugs.4bsd Subject: Re: C-Shell weirdness (count of words in a variable) Message-ID: <436@ncr-sd.UUCP> Date: Mon, 31-Mar-86 14:48:28 EST Article-I.D.: ncr-sd.436 Posted: Mon Mar 31 14:48:28 1986 Date-Received: Wed, 2-Apr-86 01:36:43 EST References: <676@nbires.UUCP> <2021@hao.UUCP> <678@nbires.UUCP> <2024@hao.UUCP> <713@ark.UUCP> Reply-To: greg@ncr-sd.UUCP (Greg Noel) Organization: NCR Corporation, San Diego Lines: 27 Xref: watmath net.unix-wizards:17419 net.bugs.4bsd:2028 In article <713@ark.UUCP> maartenj@vu44.UUCP (Huisjes Maarten Jan) writes: > > ... (a very good technical explaination of how words are parsed) ... > >The actual syntax is of `set' is : > set arg = ( wordlist ) >when you only set the arg to one word you can leave out the `(' and `)': > set arg = word >Finally you have the abbreviation : > set arg >This is exactly the same as > set arg = '' >e.i. it will set arg to a null string. Indeed, the theory is that the above is true. This is a nit, but in actual practice, the C shell uses different paths to evaluate the different cases. They are supposed to be equivalent, but sometimes they are not. I once got bitten when I did "set path = /special/commands/directory" (case two above). It turns out that the code that checks when "path" is set and exports into the PATH environment variable is only present in the flow for the first case above. Instead, you have to say "set path = ( /special/commands/directory )" to get it to work. I reported this bug and changed it in the C shell I had; I hope it's been fixed. I suppose that's a point for evolution by design......... -- -- Greg Noel, NCR Rancho Bernardo Greg@ncr-sd.UUCP or Greg@nosc.ARPA