anishsane のコメントは正しいです。設定ファイルを使用してください!
ただしexpect
、念のため、データの入力を自動化するスクリプトを次に示します。
#!/usr/bin/expect
spawn vpnc
expect "Enter IPSec gateway address;"
send "yourdata\r";
expect "Enter IPSec ID for"
send "yourdata\r";
expect "Enter IPSec secret for"
send "yourdata\r";
expect "Enter username for"
send "yourdata\r";
expect "Enter password for"
send "yourdata\r";
Jonathan が提案するように、ほとんどのデータをコマンドライン引数として渡すと、サイズを小さくすることができます。
#!/usr/bin/expect
spawn vpnc --gateway yourgateway --id yourid --username yourusername
expect "Enter IPSec secret for"
send "yourdata\r";
expect "Enter password for"
send "yourdata\r";
しかし、すでに述べたように、それは進むべき道ではありません。代わりに設定ファイルを使用してください。