xref: /freebsd/usr.bin/nohup/nohup.1 (revision 02e9120893770924227138ba49df1edb3896112a)
1.\" Copyright (c) 1989, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Institute of Electrical and Electronics Engineers, Inc.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.Dd June 26, 2023
32.Dt NOHUP 1
33.Os
34.Sh NAME
35.Nm nohup
36.Nd invoke a utility immune to hangups
37.Sh SYNOPSIS
38.Nm
39.Op Fl Fl
40.Ar utility
41.Op Ar arguments
42.Sh DESCRIPTION
43The
44.Nm
45utility invokes
46.Ar utility
47with its
48.Ar arguments
49and at this time sets the signal
50.Dv SIGHUP
51to be ignored.
52If the standard output is a terminal, the standard output is
53appended to the file
54.Pa nohup.out
55in the current directory.
56If standard error is a terminal, it is directed to the same place
57as the standard output.
58.Pp
59Some shells may provide a builtin
60.Nm
61command which is similar or identical to this utility.
62Consult the
63.Xr builtin 1
64manual page.
65.Sh ENVIRONMENT
66The following variables are utilized by
67.Nm :
68.Bl -tag -width flag
69.It Ev HOME
70If the output file
71.Pa nohup.out
72cannot be created in the current directory, the
73.Nm
74utility uses the directory named by
75.Ev HOME
76to create the file.
77.It Ev PATH
78Used to locate the requested
79.Ar utility
80if the name contains no
81.Ql /
82characters.
83.El
84.Sh EXIT STATUS
85The
86.Nm
87utility exits with one of the following values:
88.Bl -tag -width Ds
89.It 126
90The
91.Ar utility
92was found, but could not be invoked.
93.It 127
94The
95.Ar utility
96could not be found or an error occurred in
97.Nm .
98.El
99.Pp
100Otherwise, the exit status of
101.Nm
102will be that of
103.Ar utility .
104.Sh SEE ALSO
105.Xr builtin 1 ,
106.Xr csh 1 ,
107.Xr timeout 1 ,
108.Xr signal 3 ,
109.Xr daemon 8
110.Sh STANDARDS
111The
112.Nm
113utility is expected to be
114.St -p1003.2
115compatible.
116.Sh BUGS
117Two or more instances of
118.Nm
119can append to the same file, which makes for a confusing output.
120