I was wondering if I could redirect a file to the stdin of a program so that I could actually see the lines of the file as they're being used.
Suppose I have a CLI program with the following flow (in a loop): A) Computer asks question B) User answers it C) Computer responds
Running this interactively yields output (which can be copied and pasted from the terminal) that intermixes user answers with computer generated text.
I need to get the same result for a situation where the program is run non-interactively and where the answers are predefined in a file.
Is there a way to get the same kind of text that would appear on the terminal screen of such a program run interactively?