Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: exiting from functions and scripts
- X-seq: zsh-users 1455
- From: Bernd Eggink <eggink@xxxxxxxxxxxxxx>
- To: "Owen M. Astley" <oma1000@xxxxxxxxx>
- Subject: Re: exiting from functions and scripts
- Date: Fri, 17 Apr 1998 10:57:34 +0200
- Cc: zsh-users@xxxxxxxxxxxxxxx
- Organization: RRZ Uni Hamburg
- References: <Pine.OSF.3.96.980417090442.15045D-100000@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Sender: rz2a022@xxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxx
http://www.rrz.uni-hamburg.de/eggink/BEggink.html
Messages sorted by:
Reverse Date,
Date,
Thread,
Author