title: Bash script to automatically test program output - C
body: <p>I am very new to writing scripts and I am having trouble figuring out how to get started on a bash script that will automatically test the output of a program against expected output. </p>
  
  <p>I want to write a bash script that will run a specified executable on a set of test inputs, say in1 in2 etc., against corresponding expected outputs, out1, out2, etc., and check that they match. The file to be tested reads its input from stdin and writes its output to stdout. So executing the test program on an input file will involve I/O redirection. </p>
  
  <p>The script will be invoked with a single argument, which will be the name of the executable file to be tested. </p>
  
  <p>I'm having trouble just getting going on this, so any help at all (links to any resources that further explain how I could do this) would be greatly appreciated. I've obviously tried searching myself but haven't been very successful in that. </p>
  
  <p>Thanks!</p>