使用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