EXIT(1SH) COMMAND REFERENCE EXIT(1SH)
NAME
exit - causes shell to exit (sh built-in)
SYNOPSIS
exit [ n ]
DESCRIPTION
exit causes a shell to exit with the exit status specified
by n. If n is omitted, the exit status is that of the last
command executed. An end-of-file will also exit from the
shell. The shell variable $? will contain the exit status
of any process.
EXAMPLES
The following shell script exits with the number of
arguments it is given.
#!/bin/sh
exit $#
RETURN VALUE
The exit status of exit is the value of the argument, or the
status of the last command executed.
CAVEATS
The default exit status comes from the exit status of the
last command executed. This includes built-in commands such
as break and continue, which always exit with 0.
Functions are executed in the current shell, so they should
use return instead of exit unless they are used to terminate
the shell.
SEE ALSO
break(1sh), cd(1sh), chdir(1sh), continue(1sh), csh(1csh),
echo(1sh), eval(1sh), exec(1sh), exit(1csh), export(1sh),
hash(1sh), login(1), pwd(1sh), read(1sh), readonly(1sh),
return(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), execve(2), ERROR(3c), and
exit(3c).
Printed 4/6/89 1
%%index%%
na:288,98;
sy:386,148;
de:534,443;
ex:977,214;
rv:1191,272;
ca:1463,649;
se:2112,946;
%%index%%000000000119