我有一个有自己提示的程序
example_program>
Run Code Online (Sandbox Code Playgroud)
我需要通过这个程序运行一系列命令
example_program> command_A
example_program> command B
Please enter input: [input_here]
example_program> command C
Run Code Online (Sandbox Code Playgroud)
我可以通过 shell 脚本中的以下行发送命令 A、B、C:
(echo "command_C" && cat) | (echo "command_B" && cat) | (echo "command_A" && cat ) | example_program
Run Code Online (Sandbox Code Playgroud)
如何输入所需的输入并在命令 B ([input_here]) 后提示输入?
我无权发送或期待。