Pass input to an interactive command line program in bash
I have a program that has its own prompt
example_program>
I need to run a series of commands through this program
example_program> command_A
example_program> command B
Please enter input: [input_here]
example_program> command C
I can send commands A, B, C via the following line in a shell script:
(echo "command_C" && cat) | (echo "command_B" && cat) | (echo "command_A" && cat ) | example_program
How can I enter the required input and get the request after the B ([input_here]) command?
I have no access to send or wait.
+3
source to share