title: Keeping a bash script running along the program it has started, and sending the program input
body: <p>I'm writing a very simple script to control a process,
  script checks if the process is running, if not: executes it.</p>
  
  <p>I need to expand this with the ability to kill a specific process instance (very one one script has started) after a specified amount of time.
  Problem is, once bash script is executed it isn't running until the executed program finishes.Ability to pass some input to the process would also be useful, as I have a graceful exit function built in to the service I'm running.</p>
  
  <p>Basically, my bash script should run along the process it's started, and send a kill command via stdin after sleep x times out.</p>
  
  <p>How do I forward some scripted input to the process script has started, and how do I keep the script running after executing the process?</p>
  
  <p>Thanks in advance.</p>