1847063 Members
6470 Online
110261 Solutions
New Discussion

Re: nohup

 
Angela Swyers_1
Frequent Advisor

nohup

I have a job that is running with nohup. It is prompting me fro a response. How do I pass that into the script so that it will continue?
4 REPLIES 4
Bill Hassell
Honored Contributor

Re: nohup

Well, as you might expect, an interactive program (something that requires you type an answer) is not suitable for batch (background) jobs. There is no simple answer. If at all possible, use a program that does not require a keyboard response. If the program allows for command line options, put all the required options on the command line. Perhaps the program will accept stdin as a source for answers to questions. You'll have to ask the author of the program if this is possible.

Otherwise, you'll have to get a copy of the expect program (which requires TCL Toolkit to also be installed). You can find expect and tcltk at http://hpux.connect.org.uk/


Bill Hassell, sysadmin
Michael Schulte zur Sur
Honored Contributor

Re: nohup

Hi,

if you can predict the answer the programme needs then you can provide it like
nohup command < answers

hth,

Michael
Devender Khatana
Honored Contributor

Re: nohup

Hi,

You can bring background jobs in forground with fg command.Alongwith this you can check all running background jobs with "jobs" command. It will work only if shell through which this job was started has not been terminated yet.

fg will bring the n number background job into foreground. Where n is the job number from the output of jobs command.

HTH,
Devender
Impossible itself mentions "I m possible"
Geoff Wild
Honored Contributor

Re: nohup

You may also want to look at an expect script.

http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.42/

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.