'\"macro stdmacro
.if n .pH g1.nohup @(#)nohup	40.4 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} nohup 1 "User Environment Utilities" "\&"
.if \nX=1 .ds x} nohup 1 "User Environment Utilities"
.if \nX=2 .ds x} nohup 1 "" "\&"
.if \nX=3 .ds x} nohup "" "" "\&"
.TH \*(x}
.tr ~
.SH NAME
\f4nohup\f1 \- run a command immune to hangups and quits
.SH SYNOPSIS
\f4nohup\f1
\f2command\f1 [ \f2arguments\f1 ]
.SH DESCRIPTION
\f4nohup\fP
executes
.I command\^
with hangups
and quits ignored.
If output is not re-directed by the user,
both standard output and standard error are sent to
\f4nohup.out\f1.
If
\f4nohup.out\f1
is not writable in the current directory,
output is redirected to
\f4\s-1$HOME\s+1/nohup.out\f1.
.SH EXAMPLE
It is frequently desirable to apply 
\f4nohup\fP
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:
.sp
.RS
\f4nohup sh\f1 \f2file\f1
.RE
.sp
and the 
\f4nohup\fP
applies to everything in 
.IR file.
If the shell procedure
.I file 
is to be executed often, 
then the need to type  
\f4sh\fP
can be eliminated by giving
.IR file 
execute permission.
Add an ampersand and the contents of
.I file
are run in the background with interrupts also ignored (see 
\f4sh\fP(1)):
.sp
.RS
\f4nohup\f1 \f2file\f1 \f4&\f1
.RE
.sp
An example of what the contents of 
.IR file
could be is:
.sp
.RS
\f4sort ofile > nfile\f1
.RE
.SH SEE ALSO
\f4chmod\fP(1), \f4nice\fP(1), \f4sh\fP(1),
.br
\f4signal\fP(2) in the \f2Programmer's Reference Manual\f1.
.SH NOTES
In the case of the following command
.sp
.RS
\f4nohup command1; command2\f1
.RE
.sp
\f4nohup\fP
applies only to
\f4command1\f1.
The command
.sp
.RS
\f4nohup (command1; command2)\f1
.RE
.sp
is syntactically incorrect.
'\"   The following passage is not applicable to the 3B2.
'\"Be careful of where standard error is redirected.
'\"The following command may put error messages on tape,
'\"making it unreadable:
'\".sp
'\"		nohup cpio -o <list >/dev/rmt/1m&
'\".br
'\"while
'\".br
'\"		nohup cpio -o <list >/dev/rmt/1m 2>errors&
'\".sp
'\"puts the error messages into file
'\".IR errors .
'\"	@(#)nohup.1	6.4 of 4/2/84
.Ee
