3 ms·
The standard is expect [1]. There are also libraries for many programming languages which perform a similar task, such as pexpect [2]. [1] https://core.tcl.tk/
by milkey_mouse 8y ago
The standard is expect [1]. There are also libraries for many programming languages which perform a similar task, such as pexpect [2].
[1] https://core.tcl.tk/expect/index https://core.tcl.tk/expect/index
[2] https://pexpect.readthedocs.io/en/stable/ https://pexpect.readthedocs.io/en/stable/
- richardwhiuk 8y agoThe better solution is to change the command so it expects programatic arguments / pass command line parameters. i.e. prefer `apt-get install -y` over `yes | apt-get install foo`