title: Running a process that waits on input in the background, without it pausing and without sending input
body: <p>I have a program that does something like this in order to wait on someone pressing enter in order to quit:</p>
  
  <pre><code>spawnThreadAndDoStuff();
  System.in.read();
  System.exit(0);
  </code></pre>
  
  <p>I want to run it in the background indefinitely from a script, and just go kill it when I want it to end.  I thought reading input from /dev/null would do this, but it doesn't seem to be working.  My script looks like:</p>
  
  <pre><code>#!/bin/bash
  java -cp someapp &gt; mylog.log &lt; /dev/null &amp;
  </code></pre>
  
  <p>Am I doing this wrong, or is my approach just way off?  What would the correct way to handle this be?</p>