I’m in a course for C++ programming.
Our professor created a linux validation script against which our program output must match exactly.
It’s running out of his own program and generates an output.txt file, then compares it against his output file, if it doesn’t match it rejects the script.
The problem is, this program excepts probably 150-200 lines of input and if anything goes in wrong you have to start all over again. If you even enter an incorrect char, it must be restarted as the backspace registers as a character of its own.
How might I generate a bash script that would feed all of the input into the program automatically?
NOTE: We have to use his program as in: ~professor.name/submit asigname
Advertisement
Answer
How might I generate a bash script that would feed all of the input into the program automatically?
Without any example code or input/output, it is hard to gauge what precisely is that you need.
Otherwise, for a generic tool to automate interactive console programs, I would suggest to take a look at the Expect
.