title: How to write shell script to enter commands into a console program
body: <p>I have to open up a command-line program and type in the following commands</p>
  
  <pre><code> # From the command-line
   $ ./console.sh
  
   Welcome to Super Awesome Program 1.0 that I didn't write!
   Type 'help' to see all the commands supported.
  
   &gt; some_command1 arg1
   Done.
   &gt; some_command2 arg2
   Done.
   &gt; some_command3 arg3
   Done.
  
   ...
  
   &gt; some_command100 arg100
   Done.
  </code></pre>
  
  <p>Obviously I don't want to write a hundred of these commands.  Is there an automated way to do this?</p>
  
  <p>I tried</p>
  
  <pre><code>echo "some_command3 arg3" | ./console.sh
  </code></pre>
  
  <p>But that didn't work.</p>
  
  <p>In general, is there a nice way to do this?</p>
  
  <p>EDIT: A lot of the comments asked me to look at "console.sh".  I looked at it and it seems like "console.sh" is just a wrapper for Java binaries.  Here is the gist of "console.sh": <a href="https://gist.github.com/anonymous/0c1d9b05b94f3960f058" rel="nofollow">https://gist.github.com/anonymous/0c1d9b05b94f3960f058</a></p>