Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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 (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

Your Answer


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.