Help needed with conditional statement for alias in csh

Dave Eisen dkeisen at Gang-of-Four.Stanford.EDU
Thu Sep 20 19:06:27 AEST 1990


In article <1990Sep18.223605.29379 at eua.ericsson.se> per at 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 at Gang-of-Four.Stanford.EDU           Office: (415) 967-5644
1447 N. Shoreline Blvd.
Mountain View, CA 94043



More information about the Comp.unix.shell mailing list