尝试自动回答交互式提示
我尝试使用printf
和echo
似乎没有用...
echo "o 3 Y N Y N Y Y N" | ./xxxx.bin
printf "o 3 Y N Y N Y Y N" | ./xxxx.bin
以下是提示示例
This will install Software 1.1 on your computer.
OK [o, Enter], Cancel [c]
o
Choose the appropriate installation or upgrade option.
Please choose one of the following:
Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2], Upgrade an existing installation [3, Enter]
3
等
答案 0 :(得分:0)
尝试:
printf "o\n3\nY\nN\nY\nN\nY\nY\nN\n" | { ./xxxx.bin ; }
答案 1 :(得分:0)
我建议使用here document来提供命令/答案列表,您可以轻松维护输入。
./xxxx.bin << EOF
o
3
Y
N
Y
N
Y
Y
N
EOF