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

Re: exiting from functions and scripts



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