title: How to use a linux expect script to enter answer a prompt for password
body: <p>I am having some trouble writing a script that will launch my forticlient vpn command line client and send my password when it is prompted.  Here is my code:</p>
  
  <pre><code>#!/usr/bin/expect -f
  set loadme "./forticlientsslvpncli --server myvpnserver --vpnuser theuser
  eval spawn $loadme
  expect "Password for VPN: "
  send "password\r"
  </code></pre>
  
  <p>However, it still prompts for the vpn password.  I am sure it is something simple and I am pretty new to linux scripting, but any help would be greatly appreciated!</p>
  
  <p>Thanks!</p>