shell脚本的自动交互

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

#!/usr/bin/expect
spawn openssl req -new -key server.key -out server1.csr
expect "Country Name"
send "\n"
expect "State or Province Name"
send "\n"
interact 
posted @ 2015-04-02 12:17  武汉-磨渣  阅读(121)  评论(0编辑  收藏  举报