C-Shell weirdness (count of words in a variable)
Greg Noel
greg at ncr-sd.UUCP
Tue Apr 1 05:48:28 AEST 1986
In article <713 at ark.UUCP> maartenj at 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 at ncr-sd.UUCP or Greg at nosc.ARPA
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list