Runs a command without hangups.
nohup Command [ Arg ... ] [ & ]
The nohup command runs the command specified by the Command parameter and any related Arg parameters, ignoring all hangup (SIGHUP) signals. Use the nohup command to run programs in the background after logging off. To run a nohup command in the background, add an & (ampersand) to the end of the command.
Whether or not the nohup command output is redirected to a terminal, the output is appended to the nohup.out file in the current directory. If the nohup.out file is not writable in the current directory, the output is redirected to the $HOME/nohup.out file. If neither file can be created nor opened for appending, the command specified by the Command parameter is not invoked. If the standard error is a terminal, all output written by the named command to its standard error is redirected to the same file descriptor as the standard output.
This command returns the following exit values:
126 | The command specified by the Command parameter was found but could not be invoked. |
127 | An error occurred in the nohup command or the command specified by the Command parameter could not be found. |
Otherwise, the exit status of the nohup command is that of the command specified by the Command parameter.
$ nohup find / -print &
After you enter this command, the following is displayed:
670 $ Sending output to nohup.out
The process ID number changes to that of the background process started by & (ampersand). The message Sending output to nohup.out informs you that the output from the find / -print command is in the nohup.out file. You can log off after you see these messages, even if the find command is still running.
$ nohup find / -print >filenames &
This example runs the find / -print command and stores its output in a file named filenames. Now only the process ID and prompt are displayed:
677 $
Wait before logging off because the nohup command takes a moment to start the command specified by the Command parameter. If you log off too quickly, the command specified by the Command parameter may not run at all. Once the command specified by the Command parameter starts, logging off does not affect it.
neqn math1 | nroff > fmath1
and name it the nnfmath1 file, you can run the nohup command for all of the commands in the nnfmath1 file with the command:
nohup sh nnfmath1
nohup nnfmath1
nohup ksh nnfmath1
The csh command, nice command, sh command.
The signal subroutine.