NOHUP(1V) — USER COMMANDS
NAME
nohup − run a command immune to hangups and quits
SYNOPSIS
nohup command [ arguments ]
DESCRIPTION
There are three distinct versions of nohup: it is built in to the C-Shell, and is an executable program available in /usr/bin/nohup and /usr/5bin/nohup when using the Bourne shell.
nohup executes command such that it is immune to HUP (hangup) and QUIT (quit) signals. If the standard output is a terminal, it is redirected to the file nohup.out. If nohup.out is not writable in the current directory, output is redirected to $HOME/nohup.out. If the standard error is a terminal, it is redirected to the standard output.
The priority is incremented by 5. nohup should be invoked from the shell with ‘&’ in order to prevent it from responding to interrupts or input from the next user.
EXAMPLE
It is frequently desirable to apply nohup to pipelines or lists of commands. This can be done only by placing pipelines and command lists in a single file, called a shell script. The command
manual% nohup sh script
applies to everything in script. (If the script is to be executed often, then the need to type sh can be eliminated by giving script execute permission). Add an ampersand and the contents of script are run in the background with interrupts also ignored (see sh(1)):
manual% nohup script &
FILES
nohup.out
$HOME/nohup.out
SEE ALSO
chmod(1V), nice(1), sh(1), signal(2)
BUGS
If you use csh(1), then commands executed with ‘&’ are automatically immune to HUP signals while in the background.
There is a C-Shell built-in command nohup which provides immunity from terminate, but it does not redirect output to nohup.out.
WARNINGS
nohup command1; command2~~~~~ nohup applies only to command1
nohup (command1; command2)is syntactically incorrect.
Be careful of where standard error is redirected. The following command may put error messages on tape, making it unreadable:
nohup cpio −o <list >/dev/rmt/1m&
while
nohup cpio −o <list >/dev/rmt/1m 2>errors&
puts the error messages into file errors.
Sun Release 3.5 — Last change: 18 July 1986