sh
exit [n]
return [n]
csh
exit [ ( expr )]
goto label
ksh
*exit [n]
*return [n]
....
ksh
exit will cause the calling shell or shell script to exit
with the exit status specified by n.
The value will be the
least significant 8 bits of the specified status. If n is
omitted then the exit status is that of the last command
executed. When exit occurs when executing a trap, the
last command refers to the command that executed before the
....
return causes a shell function or '.' script to return to
the invoking script with the return status specified by n.
The value will be the least significant 8 bits of the speci-
fied status. If n is omitted then the return status is that
of the last command executed. If return is invoked while
not in a function or a '.' script, then it is the same as an
exit.
Partager