NOHUP(1V)

NAME
nohup - run a command immune to hangups and quits

SYNOPSIS
/usr/bin/nohup command [ arguments ]

SYSTEM V SYNOPSIS
/usr/5bin/nohup command [ arguments ]

AVAILABILITY
The System V version of this command is available with the System V software installation option. Refer to for information on how to install optional software.

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.

The Bourne shell version of nohup executes command such that it is immune to HUP (hangup) and TERM (terminate) signals. If the standard output is a terminal, it is redirected to the file nohup.out. The standard error is redirected to follow 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.

SYSTEM V DESCRIPTON
Processes run by nohup are immune to HUP (hangup) and QUIT (quit) signals; nohup does not arrange to make them immune to a TERM (terminate) signal, so unless they arrange to be immune to a TERM signal, or the shell makes them immune to a TERM signal, they will receive that signal. 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, otherwise it is not redirected. The priority of the process run by nohup is not altered.

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

    example% 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)):

    example% nohup script &

FILES
nohup.out
$HOME/nohup.out

SEE ALSO
chmod(1V), csh(1), nice(1), sh(1), signal(3V)

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 that provides immunity from terminate, but does not redirect output to nohup.out.

nohup does not recognize command sequences. For instance,

    nohup command1; command2

applies only to command1 and the command:

    nohup (command1; command2)

is syntactically incorrect.

Be careful of where the 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 the file errors.