February 2001
Beginner to intermediate
448 pages
9h 2m
English
Official Description
Causes a shell function to return to the invoking script with the return status specified by n.
Syntax
return [n]
Options
None
Oddities
If return is invoked while not in a function or a . (dot) script, it is the same as an exit.
Example
$ function ob_1 { # Create function that returns 32
> print "Can ob?"
> return 32 # Returns arbitrary number (32)
> }
$
$ ob_1 # Execute function
Can ob?
$ print $? # Display return status
32
$
Read now
Unlock full access