title: Writing a Shell Script that runs my program with inputs
body: <p>Ok so I created my own shell, and I've tested it plenty on my own, but I need shell scripts that will run it and test it. </p>
  
  <p>I've create a script which consist of this:</p>
  
  <pre><code>#!/bin/bash
  echo "ls &amp;&amp; echo dog" | ./a.out
  </code></pre>
  
  <p>However, all it does is print the command prompt "$" infinitely, and I have to force quit the program. therefore I am pretty sure my program does not like my script lol. My program works by using getline to capture the user input until they push &lt;enter> and the boost library to tokenize the string and look for connector e.g "||" "&amp;&amp;" ";" and  and so on, then run the commands. All of this is done in a while loop that loops until the user types exit and I close my program. Being as I am new to writing scripts I am sure I probably am not writing my script in the best of manners. I created a simple program to ask for your age and then output it and this script method works for that, but being as my shell isn't as simple I am not surprised this scrip doesn't seem to work. </p>
  
  <pre><code>string user_input;
  bool good = true;
  typedef boost::tokenizer&lt;boost::char_separator&lt;char&gt; &gt; tokenizer;
  
      while(good){
          //command prompt
          cout &lt;&lt; "$ "; 
  
          //read in user input
          getline(cin, user_input);
  
          //tokenize user input
          tokenizer tok(user_input);
          //parse and execute commands inputed by user in string 
          //only exit while loop if user command is &lt;exit&gt; good = false    
      }
  </code></pre>
  
  <p>my shell works if I execute the program normally and I enter inputs into the program what I need is a shell script that I can use to run and test the program for me. Ex. if I type  ./script.sh in the standard linux shell it will run my script which will then execute my a.out and then test my own shell with a variety of commands Examples being ls echo ...</p>