Trouble using nohup with &

Reply

Join Date: Nov 2009
Posts: 12
Reputation: chandini.david is an unknown quantity at this point 
Solved Threads: 0
chandini.david chandini.david is offline Offline
Newbie Poster

Trouble using nohup with &

 
0
  #1
14 Days Ago
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??
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the Getting Started and Choosing a Distro Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC