Til*_*gel 121
echo -ne '\n' | <yourfinecommandhere>
Run Code Online (Sandbox Code Playgroud)
或利用echo产生的隐含换行(感谢Marcin)
echo | <yourfinecommandhere>
Run Code Online (Sandbox Code Playgroud)
pav*_*ium 38
您可能会发现该yes命令很有用.
看到 man yes
ken*_*orb 22
以下是使用示例的示例expect:
#!/usr/bin/expect
set timeout 360
spawn my_command # Replace with your command.
expect "Do you want to continue?" { send "\r" }
Run Code Online (Sandbox Code Playgroud)
检查:man expect了解更多信息.