From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7952 invoked by alias); 14 May 2014 14:22:05 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18801 Received: (qmail 4712 invoked from network); 14 May 2014 14:21:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 14 May 2014 16:21:55 +0200 From: Florian Lindner To: zsh-users@zsh.org Subject: Re: Stop script if one command returns =?UTF-8?Q?!=3D=20=30?= In-Reply-To: References: Message-ID: <355857b792fd08eade06510fd648684d@xgm.de> X-Sender: mailinglists@xgm.de User-Agent: Roundcube Webmail/1.0.1 Am 14.05.2014 16:01, schrieb Florian Lindner: > Hello, > > 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? Ok, just a second after the mail I learned about set -e. The problem is when sourcing the script it kills my entire shell. I tried installing a trap trap 'echo "Hallo"' TERM INT ABRT EXIT (just a as first shot, trying to catch almost anything) but changed nothing. Any ideas how do deal with that? Thanks! Florian