Take the 2-minute tour ×

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:

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


