So I am trying to compile then run c++ with piped input in a shell script. I have to grade 113 programming assignments and I don't want to compile and then run test cases individually. Code:
#!/bin/bash
echo "the script starts now."
g++ Q2.cpp -o q2
./q2 < ~/scripts/t12.txt
./q2 < ~/scripts/t13.txt
Then I get the error: 'No such file or directoryt.sh: line 4: /home/stevenm/scripts/t12.txt' and 'No such file or directoryt.sh: line 5: /home/stevenm/scripts/t13.txt'
but this will work when I run it myself in the command line.