From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4459 invoked from network); 17 Apr 1998 09:20:11 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 17 Apr 1998 09:20:11 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id EAA05537; Fri, 17 Apr 1998 04:57:45 -0400 (EDT) Resent-Date: Fri, 17 Apr 1998 04:57:34 -0400 (EDT) Sender: rz2a022@uni-hamburg.de Message-ID: <3537197E.6FD1B871@rrz.uni-hamburg.de> Date: Fri, 17 Apr 1998 10:57:34 +0200 From: Bernd Eggink Organization: RRZ Uni Hamburg X-Mailer: Mozilla 4.04 [en] (X11; I; AIX 4.2) MIME-Version: 1.0 To: "Owen M. Astley" CC: zsh-users@math.gatech.edu Subject: Re: exiting from functions and scripts References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-Message-ID: <"Dxhmd1.0.yL1.zbnDr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1455 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Owen M. Astley wrote: > > Is there a command that will exit from a function or script with a > particular code? > eg something like exit (that only works in scripts) or return (that only > works in functions) Exit works in functions, too. It returns from the shell (not just the function) with a given code. Return works in scripts, too. If called outside a function, it behaves like exit. Regards, Bernd -- Bernd Eggink Regionales Rechenzentrum der Uni Hamburg eggink@rrz.uni-hamburg.de http://www.rrz.uni-hamburg.de/eggink/BEggink.html