C-Shell weirdness (count of words in a variable)

jsdy at hadron.UUCP jsdy at hadron.UUCP
Sat Mar 29 18:28:59 AEST 1986


In article <2024 at hao.UUCP> woods at hao.UUCP (Greg Woods) writes:
>> Sorry, I tried the example that is supposed to yield zero and I got one
>> instead.
>> The answer is that you can't have a variable with 0 words at all.
>> This fact I find counter-intuitive and undocumented

Try set hosed = ().  This is suggested by woods' own earlier posting.
This is the way to get $#hosed == 0.  Anything else (including just
set hosed) sets the variable to one or more words.

>> I still can't figure out where
>> the documentation says that if a variable name in an if test expands to
>> one of -r, -w, -x etc, the shell will interpet the expanded variable name
>> as a command.

See my earlier posting.  What do you expect csh to do with
	if (-e == -b)
???	[;-)]

BTW, why is it that woods at hao's responses keep getting here before
the questions from nbires?   [rhetorical question, mostly.]
-- 

	Joe Yao		hadron!jsdy at seismo.{CSS.GOV,ARPA,UUCP}



More information about the Comp.unix.wizards mailing list