Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个这样的 bash 脚本:
#some commands #..... read answer #.... #Other commands
答案应该是yes或no。
yes
no
我想运行脚本并绕过读取answer给它 value yes。但我无法编辑脚本的代码。
answer
无论如何使用参数或一些bash工具来做到这一点?
只需将“是”输入脚本的标准输入:
echo yes | your_bash_script