#!/usr/bin/expect -f set timeout -1 set username yuxing.chen@unitn.it set password cyx21301 #set OTP [lindex $argv 2] spawn ./openconnect --protocol=gp gp-vpn.icts.unitn.it --user=$username expect "Password:*" send -- "$password\r" #expect "*OTP:*" #send -- $OTP\r" expect eof