Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Apropos / Subsearch:
optional field

NOHUP(1V)                                                            NOHUP(1V)

       nohup - run a command immune to hangups and quits

       /usr/bin/nohup command [ arguments ]

       /usr/5bin/nohup command [ arguments ]

       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.

       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.

       Processes run by nohup are immune to HUP (hangup) and QUIT (quit)  sig-
       nals;  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 sig-
       nal.  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.

       It is frequently desirable to apply nohup to pipelines or lists of com-
       mands.  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 exe-
       cute  permission).  Add an ampersand and the contents of script are run
       in the background with interrupts also ignored (see sh(1)):

              example% nohup script &&


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

       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 <&lt; list >&gt; /dev/rmt/1m&&amp;


              nohup cpio -o <&lt; list >&gt; /dev/rmt/1m 2>&gt;errors&&amp;

       puts the error messages into the file errors.

                                10 January 1988                      NOHUP(1V)