Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!bellcore!ulysses!mhuxr!mhuxt!houxm!ihnp4!cuae2!ltuxa!we53!wucs!wucec2!jdz From: jdz@wucec2.UUCP Newsgroups: net.unix-wizards Subject: Re: Re: C-Shell weirdness Message-ID: <1520@wucec2.UUCP> Date: Tue, 1-Apr-86 13:57:14 EST Article-I.D.: wucec2.1520 Posted: Tue Apr 1 13:57:14 1986 Date-Received: Sat, 5-Apr-86 01:38:33 EST References: <676@nbires.UUCP> <2021@hao.UUCP> <196@cfa.UUCP> <2365@teddy.UUCP> Reply-To: jdz@wucec2.UUCP (Jason D. Zions) Distribution: net Organization: Wash. U. Center for Engineering Computing Lines: 22 In article <2365@teddy.UUCP> jpn@teddy.UUCP (John P. Nelson) writes: >Uh, all csh variables (except argv) will always have ONE element unless you >used the set notation when setting their value. The way to create a variable >with zero elements is: > >set hosed = () Not quite. If you use execution quotes (i.e. `foo`) you can get variables with zero elements. I have a shell script which returns a list of users doing slightly anti-social things on our network of student machines; I do this: set abusers=`anti-social_stuff`; if ($#abusers) flog $abusers ; unset abusers Which flogs anyti-social abusers, if any. If the shell script returns nothing (i.e. send nothing to its stdout) then abusers has zero elements. Which is how one would hope it would behave. -- Jason D. Zions ...!{seismo,cbosgd,ihnp4}!wucs!wucec2!jdz Washington University Center for Engineering Computing Box 1045 St. Louis MO 63130 USA (314) 889-5097 No need to disclaim - they know I'm doing this!