Pass input to interactive command line program in bash
bash, cat, echo, linux, shell
Solution
I'm guessing this will work, but it's only a guess since we don't know how your program is reading the responses: use a here-doc, and put the input for command B after invoking command B
example_program <<'END'
command_A
command B
input_here
command C
END
Problem
I have a program that has its own prompt ``` example_program> ``` I need to run a series of command via 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 in the input needed and am prompted for after command B ([input_here])? I do not have access to send or expect.