2

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?

Travis
  • 151
  • 2
  • 6

1 Answers1

5

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).

Sven
  • 97,248
  • 13
  • 177
  • 225