我有一个接受 2 个提示(y/n)的程序。例如:
停止程序
do you want to stop the program (Y/N)? y
do you want to send an email to the admin about it (Y/N)? y
现在,我想使用“at”命令来自动化它。以下适用于 Solaris 但不适用于 Linux RHEL:
at now +5 minutes << EOF
> for i in {1..2}
> do
> echo 'y'
> done | stopprogram
> EOF
commands will be executed using /usr/bin/bash
...
...
任何想法?谢谢!