I have used gcc
and make
to compile a c
file.
The name of the run file is sequence
. I have two goals:
- Have an input file (i.e
in1
) asstdin
and run the program. when the program finishes using in1 and terminates, run it again with a different input file (i.ein2
specified in the terminal command. - Have all the outputs from all the different times the program executed go to the same file (i.e
output1
), without overriding the previous inputs. So the result will be something like this:
Input files:
in1
:
a
in2
:
b
in3
c
In program:
putchar(getchar());
Output:
a
b
c
How can I achieve the expected result via terminal command?