Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running the following inside a bash script:

nohup java server_program.jar &

I want that to start running and go about its merry way. However, for some reason it says that it is ignoring input etc. and waits for an additional return keystroke. Can I remove this wait or send the additional return from within the bash script?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

Write a short "wrapper" script that avoids the nohup redirection:

#!/bin/bash
printf "\n" | java server_program.jar &

and run this with nohup scriptname.sh (remember to make it executable and that the script might not be in your path).

share|improve this answer
    
I've tried that with my tcpmon.jar example and it works. –  Casual Coder Oct 2 '10 at 12:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.