Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

silent background job

Status
Not open for further replies.

denalibird

IS-IT--Management
Apr 20, 2001
11
US
I would like to be able to start a background job using & without it displaying a pid, and when I exit, I would like for it to not tell me "jobs are still running."

Does anyone know how to do this?

Thanks in advance for your assistance!
 
Try the nohup command. It will detach the process from the current shell and run in the background.

[morning] needcoffee
 
The nohup actually displays the pid, and I want nothing displayed.

Cruel, yours worked with the exception it hangs until you terminate. The process I'm running is tail -f. I want to capture my shell history per session in a different file to keep tract of my changes. Maybe script would be the better utility to use.

Thanks for your input.
 
denalbird,

Download, install, and use screen. It is one of several ways you could do what you are wanting. As you noted, you could also just use script, but screen is as you will see much more usefull.

 
I forgot the & after the (process). that will make it run in the background. You can replace '/dev/null ...' with script.log to track the job. use 'set +', it will generate each command that is executed to the log file.
 
I meant "set -x", not 'set +'. Sorry for the absence of mind.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top