Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ nohup(1) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

csh

nice

sh, Rsh

signal



NOHUP(1,C)                  AIX Commands Reference                   NOHUP(1,C)



-------------------------------------------------------------------------------
nohup



PURPOSE

Runs a command without hangups and then quits.

SYNTAX


nohup -- command --|


DESCRIPTION

The nohup command runs command, ignoring all hangups and quit signals.  You can
use this command to run programs in the background after you log out of the
system.  To run a nohup command in the background, add an "&" to the end of the
command.

If nohup command output is redirected to a terminal or is not redirected at
all, the output goes to the file nohup.out.  If nohup.out is not writable in
the current directory, the output is redirected to the file $HOME/nohup.out.

The syntax of this command ignores quits and hangups for only one command.  If
you want to apply nohup to a pipeline or list of commands, you can put the
pipeline or list in a shell script file.  Then you can run the sh command as
the command using the format:  "nohup sh" file.  You can also assign the shell
file execute permission and run it as the command in the form:  "nohup" file.

EXAMPLES

  1. To let a command run after you log out:

      nohup  find  /  -print  &

    Shortly after you enter this, a message such as the following is displayed:

      670
      $ Sending output to nohup.out

    The number displayed the ID of the background process.  (See page sh-2
    about starting background processes).  The "$" (dollar sign) is your shell
    prompt.  "Sending output..." is a message from nohup telling you that it is
    storing the output from the .find command in the file "nohup.out".  You can
    log out after you see these messages, even if the find command has not
    finished yet.

  2. To do the same, but redirecting the standard output to a different file:




Processed November 8, 1990        NOHUP(1,C)                                  1





NOHUP(1,C)                  AIX Commands Reference                   NOHUP(1,C)



      nohup  find  /  -print  >filenames  &

    This command runs the "find" command and stores its output in a file named
    filenames.  Now only the process ID and your prompt are displayed:

      677
      $

    Wait for a second or two before logging out, because the nohup command
    takes a moment to start the command you specify.  If you log out too
    quickly, your command may not run at all.  Once your command starts,
    logging out does not affect it.

  3. To run more than one command, use a shell procedure.  For example, if you
    write the shell procedure:

      neqn math1 | nroff > fmath1

    and name it "nnmath1", you can run the nohup command for all of the
    commands in the file "nnmath1" with the command:

      nohup sh nnmath1

    If you assign "nnmath1" execute permission, you can obtain the same results
    by issuing the command:

      nohup nnmath1

    To run this command in the background, enter the command:

      nohup nnmath1 &

RELATED INFORMATION

See the following commands:  "csh," "nice" and "sh, Rsh."

Note:  The csh command contains a built-in subcommand named nohup.  The command
       and subcommand do not necessarily work the same way.  For information on
       the subcommand, see the csh command.

See the signal system call in AIX Operating System Technical Reference.














Processed November 8, 1990        NOHUP(1,C)                                  2



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