Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site bbncca.ARPA Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!bbncca!keesan From: keesan@bbncca.ARPA (Morris Keesan) Newsgroups: net.unix-wizards,net.unix Subject: Re: Should shell command errors abandon subsequent commands? Message-ID: <854@bbncca.ARPA> Date: Fri, 20-Jul-84 15:08:28 EDT Article-I.D.: bbncca.854 Posted: Fri Jul 20 15:08:28 1984 Date-Received: Sat, 21-Jul-84 04:11:17 EDT References: <8389@watmath.UUCP> Organization: Bolt, Beranek and Newman, Cambridge, Ma. Lines: 19 ------------------------------- Shell command errors should NOT abandon subsequent commands, if the commands are separated, as in the examples, by semicolons. Semicolons should behave exactly like newline. This should be true regardless of whether the shell is interactive (from the terminal) or running a script. The separator ';' means "execute the first command, then execute the second." The separator '&&' means "execute the first command, and if it succeeds (i.e. returns exit status 0) then execute the second." The separator '||' means "execute the first command, and if it fails (returns non-zero exit status) then execute the second." Given the availability of the && and || separators, there is no reason and no excuse for the ; to imply any attention to the exit status. -- Morris M. Keesan {decvax,linus,ihnp4,wivax,wjh12,ima}!bbncca!keesan keesan @ BBN-UNIX.ARPA