Nohup not returns to the prompt | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Nohup not returns to the prompt

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-13-2013
pandeesh's Avatar
pandeesh pandeesh is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 22 February 2014, 4:20 AM EST
Posts: 322
Thanks: 77
Thanked 12 Times in 12 Posts
Nohup not returns to the prompt

Hi i have a script and i ma running that via nohup and &.
I am expecting that to return to the user prompt immediately.
But it's not returning and returns only after i press ctrl+c.
i am invoking the script as follow as :

Code:
nohup ./script args &


Code:
$ nohup: appending output to `nohup.out'

How to make that to return it to the user prompt immediately rather than displaying the above message and waiting?

Thanks
Sponsored Links
    #2  
Old 03-13-2013
itkamaraj's Avatar
itkamaraj itkamaraj is offline Forum Advisor  
^Kamaraj^
 
Join Date: Apr 2010
Last Activity: 16 July 2014, 11:41 PM EDT
Posts: 3,057
Thanks: 33
Thanked 657 Times in 636 Posts
try this...


Code:
nohup ./script args > /tmp/out.txt &

The Following User Says Thank You to itkamaraj For This Useful Post:
pandeesh (03-13-2013)
Sponsored Links
    #3  
Old 03-13-2013
pandeesh's Avatar
pandeesh pandeesh is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 22 February 2014, 4:20 AM EST
Posts: 322
Thanks: 77
Thanked 12 Times in 12 Posts
It's working. But what makes the difference and how it works?

Thanks,
    #4  
Old 03-13-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 24 July 2014, 6:49 PM EDT
Location: Saskatchewan
Posts: 18,976
Thanks: 748
Thanked 3,145 Times in 2,951 Posts
The only difference is redirecting the message to the text file. Otherwise they act the same.

I think it is actually returning control to your prompt, especially since you put & after it, but it prints (once) over your prompt before it does, causing confusion.
Sponsored Links
    #5  
Old 03-13-2013
alister alister is offline
Registered User
 
Join Date: Dec 2009
Last Activity: 11 June 2014, 8:40 PM EDT
Posts: 3,231
Thanks: 179
Thanked 973 Times in 789 Posts
Quote:
Originally Posted by itkamaraj View Post
Code:
nohup ./script args > /tmp/out.txt &

Quote:
Originally Posted by pandeesh View Post
It's working. But what makes the difference and how it works?
Thanks,
Quote:
Originally Posted by Corona688 View Post
The only difference is redirecting the message to the text file. Otherwise they act the same.
Actually, the message is not redirected; the message is simply not generated.

That informational message is written by nohup to stderr only when stdout is a terminal, forcing it to choose a new destination for stdout (and possibly stderr, if it to is a terminal).

Regards,
Alister
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Calculation returns no value Daniel Gate Shell Programming and Scripting 3 07-21-2011 02:14 PM
Grep returns nothing DallasT Shell Programming and Scripting 16 04-29-2010 09:34 AM
Grep without returns... mrwatkin UNIX for Dummies Questions & Answers 1 07-24-2009 01:22 PM
longjmp never returns axes Programming 2 09-10-2006 08:22 PM
script returns prompt kburrows UNIX for Dummies Questions & Answers 3 10-06-2003 10:12 AM



All times are GMT -4. The time now is 01:16 AM.