Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ nohup(1) — SunOS 5.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chmod(1)

csh(1)

nice(1)

sh(1)

shell_builtins(1)

signal(3C)

environ(5)

nohup(1)

NAME

nohup − run a command immune to hangups and quits

SYNOPSIS

/usr/bin/nohup command [ arguments ]

AVAILABILITY

SUNWcsu

DESCRIPTION

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. 

EXAMPLES

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 procedure.  One can then issue:

$ nohup sh filename

and the nohup applies to everything in filename. If the shell procedure filename is to be executed often, then the need to type sh can be eliminated by giving filename execute permission.  Add an ampersand and the contents of filename are run in the background with interrupts also ignored (see sh(1)):

$ nohup filename &

An example of what the contents of filename could be is:

sort ofilename > nfilename

ENVIRONMENT

If any of the LC_∗ variables ( LC_CTYPE, LC_MESSAGES, LC_TIME, LC_COLLATE, LC_NUMERIC, and LC_MONETARY ) (see environ(5)) are not set in the environment, the operational behavior of nohup for each corresponding locale category is determined by the value of the LANG environment variable.  If LC_ALL is set, its contents are used to override both the LANG and the other LC_∗ variables.  If none of the above variables is set in the environment, the "C"  (U.S. style) locale determines how nohup behaves. 

LC_CTYPE
Determines how nohup handles characters. When LC_CTYPE is set to a valid value, nohup can display and handle text and filenames containing valid characters for that locale.  nohup can display and handle Extended Unix Code (EUC) characters where any individual character can be 1, 2, or 3 bytes wide.  nohup can also handle EUC characters of 1, 2, or more column widths. In the "C" locale, only characters from ISO 8859-1 are valid. 

LC_MESSAGES
Determines how diagnostic and informative messages are presented. This includes the language and style of the messages, and the correct form of affirmative and negative responses.  In the "C" locale, the messages are presented in the default form found in the program itself (in most cases, U.S. English).

SEE ALSO

chmod(1), csh(1), nice(1), sh(1), shell_builtins(1), signal(3C), environ(5)

NOTES

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.  In the case of the following command

$ nohup command1; command2

nohup applies only to command1.  The command

$ nohup (command1; command2)

is syntactically incorrect.

SunOS 5.4  —  Last change: 26 Jan 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026