Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!boulder!ncar!gatech!tut.cis.ohio-state.edu!aurel.cns.caltech.edu!bfox
From: bfox@aurel.cns.caltech.edu (Brian Fox)
Newsgroups: gnu.bash.bug
Subject: exiting from functions
Message-ID: <8909281547.AA02233@aurel.cns.caltech.edu.>
Date: 28 Sep 89 15:47:55 GMT
References: <8909280811.279@munnari.oz.au>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: bfox@aurel.cns.caltech.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 22


   From: munnari!attila.esa.oz.au!robi@uunet.uu.net (RoBeRt KaRp)
   Date: Thu, 28 Sep 89 15:52:46 W


   OK, so it's not a bug, but I see a handy feature to be
   added later here.
   If I have a function:

   foo() 
   {
	   if [ -d $whatever ]
	   then
		   cd $whatever
	   else
		   exit
   }

   This will exit from the shell, not the function only. How can
   I exit from just the function.

Use "return".