944,033 Members | Top Members by Rank

Ad:
Nov 7th, 2009
0

Trouble using nohup with &

Expand Post »
Hey!!

I'm trying to use the nohup command in background mode (i.e. with the '&' at the end.)

When I generally run the program, I use the command:
./xyz "argument 1" arg 2 arg 3 arg 4 > output.txt

This works fine. Even when I append nohup to it, i.e. type:
nohup ./xyz "argument 1" arg 2 arg 3 arg 4 > output.txt
it works fine. The file output.txt is created and contains the correct data.

However, when I add the '&' sign at the end, as in:
nohup ./xyz "argument 1" arg 2 arg 3 arg 4 > output.txt &
it doesn't work... I mean it shows me a PID, and when i run 'ps', it shows that the process is running... But after I kill the process and check output.txt, the file is empty!!! I even tried checking the file without killing the process first - that didn't help either... where am I going wrong??
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
chandini.david is offline Offline
14 posts
since Nov 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Getting Started and Choosing a Distro Forum Timeline: ubuntu server help
Next Thread in Getting Started and Choosing a Distro Forum Timeline: Ctrl-A and pasting in vi editor





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC