Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!agate!shelby!neon!Gang-of-Four!dkeisen From: dkeisen@Gang-of-Four.Stanford.EDU (Dave Eisen) Newsgroups: comp.unix.shell Subject: Re: Help needed with conditional statement for alias in csh Message-ID: <1990Sep20.090627.20515@Neon.Stanford.EDU> Date: 20 Sep 90 09:06:27 GMT References: <6932.26ed237f@uwovax.uwo.ca> <26553@mimsy.umd.edu> <1990Sep18.223605.29379@eua.ericsson.se> Sender: news@Neon.Stanford.EDU (USENET News System) Organization: Sequoia Peripherals Lines: 26 In article <1990Sep18.223605.29379@eua.ericsson.se> per@erix.ericsson.se (Per Hedeland) writes: >IMHO the best solution is to use the other conditional construct, that >happens to be common to sh and csh, and apparently unbroken in the latter: > >test -s /usr/spool/mail/miller && (echo ""; echo "New mail"; echo "") > Speak for your own C-shell. In SCO Xenix, the C-shell thinks it really is C: test -s /usr/spool/mail/miller returns 0 (assuming the file is nonempty) so the C-shell doesn't evaluate the second half of the conditional expression. && and || both work exactly the opposite of how one would expect them to work (and of how they do in fact work in the Bourne shell). -- Dave Eisen Home: (415) 323-9757 dkeisen@Gang-of-Four.Stanford.EDU Office: (415) 967-5644 1447 N. Shoreline Blvd. Mountain View, CA 94043