Run a command that won't be killed when you log out.
When you log out or are otherwise disconnected, a hangup signal is sent to all your processes. Using nohup causes those signals to be ignored:
nohup myscript > myscript.out 2>&1 &
If you just do:
nohup myscript &
any output from "myscript" will be sent to "nohup.out" which will be created or appended to.
Make sure "myscript" doesn't read from standard input; that won't work without redirection:
nohup myscript < answers &
Note that you need "&" to put the command in background; nohup doesn't do that for you.
Got something to add? Send me email.
More Articles by Tony Lawrence © 2011-07-07 Tony Lawrence
Thunder is good, thunder is impressive; but it is lightning that does the work. (Mark Twain)
Printer Friendly Version
nohup Copyright © December 2003 Tony Lawrence
Have you tried Searching this site?
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.
Contact us
Printer Friendly Version