title: A bash script that takes a .c filename as an argument and then executes that file
body: <p>So I'm a grader at my college and I'm trying to create a bash script that reads in a compiled c program as an argument and then runs a bunch of tests on the program that tests a bunch of different scenarios so that I don't have to run the program with different inputs each time. </p>
  
  <p>This is what I have </p>
  
  <pre><code>#!/bin/bash
  #test.sh
  read studentFile
  
  
  $studentFile "1011" "2" "10"
  echo "11"
  ./$studentFile "1011" "2" "16"
  echo "B"
  ./$studentFile "1010" "2" "8"
  echo "12"
  ./$studentFile "FA" "16" "2" 
  echo "11111010" 
  ./$studentFile "12" "8" "2"
  echo "1010" 
  </code></pre>
  
  <p>etc. 
  (the print out following each execution is the right answer that the program should return and match)</p>
  
  <p>Whenever I run this with one a compiled c program as the input
  ie</p>
  
  <pre><code>./test.sh studentfilename
  </code></pre>
  
  <p>it returns this error </p>
  
  <pre><code>./test.sh: line 8: ./: Is a directory
  </code></pre>
  
  <p>for each line where I try to run the program.</p>
  
  <p>I've tested the input file and made sure it worked before trying to input it into this testing script.</p>
  
  <p>Does anyone know how to take a file as input and run it?</p>
  
  <p>Any help much appreciated thanks!!</p>