shell脚本的自动交互

使用expect来自动应答shell的交互

#!/usr/bin/expect
spawn openssl req -new -key server.key -out server1.csr
expect "Country Name"
send "
"
expect "State or Province Name"
send "
"
interact 
原文地址:https://www.cnblogs.com/zphj1987/p/13575301.html