I have a program,
porodry
test1
./porodry
please input your parameters file name:
test1
Please input an int number:
1110
test1.terminal
It depends on what the program really does. If it just reads from the standard input, you cat just pipe the input to it and redirect the output to a file:
echo test1 | ./porodry > test1.terminal
If it messes with the terminal, you might need expect
.