EXIT(1CSH) COMMAND REFERENCE EXIT(1CSH)
NAME
exit - exit the current shell (csh built-in)
SYNOPSIS
exit [ expr ]
DESCRIPTION
With no expr argument, exit causes the shell to exit with
the status of the last command executed. With an expr
argument, the exit status is the value of the expression.
Executing exit from a login shell causes logout(1csh) to be
executed. This means that the .logout file can be set up to
interpret exit codes as shown below.
EXAMPLES
The following shell script exits with a status equal to the
number of arguments given to it.
#!/bin/csh -f
exit $#argv
This is an example of a .logout file which uses the exit
status to determine what to do before logging out. If the
status is 10, the screen is cleared. Otherwise, the screen
is cleared, the date is printed, and the contents of the
file $HOME/.TODO are printed.
if ($status == 10) then
clear
else
clear
date
cat $HOME/.TODO
endif
RETURN VALUE
By default, the return value is the value of the last
command executed. If an expression is given, its value is
returned.
SEE ALSO
@(1csh), alias(1csh), bg(1csh), break(1csh), cd(1csh),
chdir(1csh), continue(1csh), csh(1csh), dirs(1csh),
echo(1csh), eval(1csh), exec(1csh), exit(1sh), fg(1csh),
glob(1csh), goto(1csh), hashstat(1csh), history(1csh),
jobs(1csh), kill(1csh), limit(1csh), logout(1csh),
nice(1csh), nohup(1csh), notify(1csh), onintr(1csh),
popd(1csh), pushd(1csh), rehash(1csh), repeat(1csh),
set(1csh), setenv(1csh), sh(1sh), shift(1csh), source(1csh),
stop(1csh), suspend(1csh), time(1csh), trap(1sh),
umask(1csh), unhash(1csh), unalias(1csh), unlimit(1csh),
Printed 4/6/89 1
EXIT(1CSH) COMMAND REFERENCE EXIT(1CSH)
unset(1csh), unsetenv(1csh), wait(1csh), which(1csh),
ERROR(3c), and exit(3c).
Printed 4/6/89 2
%%index%%
na:312,140;
sy:452,157;
de:609,599;
ex:1208,688;
rv:1896,262;
se:2158,1417;3959,241;
%%index%%000000000118