Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!bloom-beacon!gatech!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP (Rahul Dhesi) Newsgroups: comp.unix.questions Subject: Re: csh, exit, &&, || (was Re: exit(-1), 0 is sometimes magic) Keywords: exit, zero, shells Message-ID: <1951@bsu-cs.UUCP> Date: 25 Jan 88 16:34:46 GMT References: <502@cresswell.quintus.UUCP> <6935@brl-smoke.ARPA> <1179@wjvax.UUCP> <10318@mimsy.UUCP> <574@cresswell.quintus.UUCP> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 17 In article <574@cresswell.quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes: >But in *expressions*, && and || have the same meaning as in C. >Which is the direct opposite of their interpretation with commands! Actually, no. The C-shell uniformly gives the following meanings to these operators. && evaluate the next item iff the previous one succeeded || evaluate the next item iff the previous one failed The meaning of "item" is defined by the grammar of expressions or pipelines. That success is represented by zero for processes and by nonzero for expressions are UNIX and C conventions, not specifically a csh convention. -- Rahul Dhesi UUCP: !{iuvax,pur-ee,uunet}!bsu-cs!dhesi