RETURN(1SH) COMMAND REFERENCE RETURN(1SH)
NAME
return - exit from a function (sh built-in)
SYNOPSIS
return [ n ]
DESCRIPTION
Return causes a function to exit with the return value
specified by n. If n is omitted, the return status is that
of the last command executed.
OPTIONS
n The return value.
EXAMPLES
The following function returns the number of arguments it
was given:
args () {
return $#
}
RETURN VALUE
The return value is either the value given by the argument n
or the return value of the last command executed.
CAVEATS
Since functions are executed in the current shell, functions
should only use exit if they cause the current shell to
exit.
SEE ALSO
alias(1csh), break(1sh), cd(1sh), chdir(1sh), continue(1sh),
csh(1csh), echo(1sh), eval(1sh), exec(1sh), exit(1sh),
export(1sh), hash(1sh), login(1), pwd(1sh), read(1sh),
readonly(1sh), set(1sh), sh(1sh), shift(1sh), test(1sh),
times(1sh), trap(1sh), type(1sh), ulimit(1sh), umask(1sh),
unset(1sh), wait(1sh), which(1sh), and execve(2).
Printed 5/12/88 1
%%index%%
na:336,115;
sy:451,170;
de:621,346;
op:967,107;
ex:1074,227;
rv:1301,247;
ca:1548,257;
se:1805,894;
%%index%%000000000133