Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Stop script if one command returns != 0



On Wed, 14 May 2014 16:01:19 +0200
Florian Lindner <mailinglists@xxxxxx> wrote:
> I have a script that I source with a number of commands and exports. Is 
> there a way to tell zsh (or even in a portable way to sh) to stop 
> execution of this script if any of the commands returns a return code 
> other than zero?

(Count the responses.  I'm guessing 3 to 5...)

set -e

is standard across Bourne-like shells including zsh --- this is
equivalent to the zsh option "ERREXIT".

pws



Messages sorted by: Reverse Date, Date, Thread, Author