#!/usr/bin/expect -f
spawn /opt/cisco/anyconnect/bin/vpn
expect VPN>
send "connect thevpn.yourcompany.com\\n"
expect Group
send "0\\n" # Put the group here
expect Username
send "Your_Username_Goes_Here\\n"
expect Password
send "Your_Password_Goes_Here\\n"
expect Connected
expect VPN>
send "q\\n"