Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!mhuxm!mhuxf!mhuxi!mhuhk!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!rlgvax!hadron!jsdy From: jsdy@hadron.UUCP Newsgroups: net.unix-wizards,net.bugs.4bsd Subject: Re: C-Shell weirdness (count of words in a variable) Message-ID: <345@hadron.UUCP> Date: Sat, 29-Mar-86 03:28:59 EST Article-I.D.: hadron.345 Posted: Sat Mar 29 03:28:59 1986 Date-Received: Tue, 1-Apr-86 07:16:41 EST References: <676@nbires.UUCP> <2021@hao.UUCP> <678@nbires.UUCP> <2024@hao.UUCP> Reply-To: jsdy@hadron.UUCP (Joseph S. D. Yao) Distribution: net Organization: Hadron, Inc., Fairfax, VA Lines: 24 Xref: watmath net.unix-wizards:17408 net.bugs.4bsd:2025 Summary: set hosed = () In article <2024@hao.UUCP> woods@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@hao's responses keep getting here before the questions from nbires? [rhetorical question, mostly.] -- Joe Yao hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP}