zsh-users
 help / color / mirror / code / Atom feed
* exiting from functions and scripts
@ 1998-04-17  8:06 Owen M. Astley
  1998-04-17  8:57 ` Bernd Eggink
  0 siblings, 1 reply; 2+ messages in thread
From: Owen M. Astley @ 1998-04-17  8:06 UTC (permalink / raw)
  To: zsh-users

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)

Owen



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: exiting from functions and scripts
  1998-04-17  8:06 exiting from functions and scripts Owen M. Astley
@ 1998-04-17  8:57 ` Bernd Eggink
  0 siblings, 0 replies; 2+ messages in thread
From: Bernd Eggink @ 1998-04-17  8:57 UTC (permalink / raw)
  To: Owen M. Astley; +Cc: zsh-users

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-04-17  9:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-17  8:06 exiting from functions and scripts Owen M. Astley
1998-04-17  8:57 ` Bernd Eggink

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).