This is an extract from the bash manual obtained by typing 'man bash'. BASH(1) BASH(1) exit [n] Cause the shell to exit with a status of n. If n is omitted, the exit status is that of the last command executed. A trap on EXIT is executed before the shell terminates.