A typical interaction for a program I've written might look like this:
Enter command: a_command
Completed a command
Enter command: another_command
Completed another command
I typically run my program like ./program < input.txt, where input.txt would contain:
a_command
another_command
I want to be able to capture the entire interaction (not just the output) like above. How can I do this with bash?
EDIT: program is a binary (specifically, it's in C++), not a bash script. I have access to the source code, but I'd like to do this without having to modify the source code.