Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!ittatc!dcdwest!sdcsvax!sdchem!jwp From: jwp@sdchem.UUCP (John Pierce) Newsgroups: net.unix-wizards Subject: Re: More C-shell weirdness [Another word count problem] Message-ID: <176@sdchema.sdchem.UUCP> Date: Thu, 3-Apr-86 02:51:49 EST Article-I.D.: sdchema.176 Posted: Thu Apr 3 02:51:49 1986 Date-Received: Sat, 5-Apr-86 11:16:56 EST References: <684@nbires.UUCP> Reply-To: jwp@sdchem.UUCP (John Pierce) Distribution: net Organization: Chemistry Dept, UC San Diego Lines: 23 In article <684@nbires.UUCP> nose@nbires.UUCP (Steve Dunn) writes: > set a = '' > set a = ($a '') set a = ('' '') > echo $#a echo $#a > > Yields 1 Yields 2 and asks for an explanation.... In the first case $a is expanded to a null string before the assignment is done, and, therefore, isn't seen as a string at the time the assignment is made; there is no such thing as an unquoted null string (this is implied, though not stated explicitly in exactly those words by csh(1), page 1, "Lexical Structure"). Note that set a = '' set a = ( "$a" '' ) echo $#a yields 2 since the null string that is $a is quoted and is, therefore, a word. John Pierce, Chemistry, UC San Diego jwp%chem@ucsd.edu sdcsvax!sdchem!jwp