Subject: Re: return vs. exit
To: <>
From: David Laight <david@l8s.co.uk>
List: netbsd-help
Date: 04/05/2003 19:30:09
> i've following question - what's the general difference between
> exit [value]
> and
> return [value]
> 
> in shell script (/bin/sh). i'm not sure. is it:
> exit - abort processing of the whole script
> return - abort processing of the innermost cycle/operation (i.e. abort 
> currently processed while, for, case)

exit causes the (sub)shell prcess executing the commands to exit.
return is used to leave a shell function.

	David

-- 
David Laight: david@l8s.co.uk