Prerequisite
1. expect
2. forticlientsslvpn_cli
#!/usr/bin/expect -f set timeout -1 cd /opt/forticlient-sslvpn/64bit spawn ./forticlientsslvpn_cli --server <ip-address>:<port> --vpnuser <username> expect "Password for VPN:" {send -- "<password>\r"} expect "to this server? (Y/N)\r" {send -- "y\r"} expect eof
Note:-
To escape any special character like $ please use