unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

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

NOHUP(1V)                                                            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)  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.

EXAMPLE
       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 &&

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

       while

              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)