title: use expect in shell script
body: <p>I need to pass two arguments to expect, first one is the command to execute, the second one is the password.</p>
  
  <p>here's my expect.sh</p>
  
  <pre>
  #!/usr/bin/expect
  spawn [lrange $argv 0 0]
  expect "password:"
  send [lindex $argv 1]
  interact
  </pre>
  
  <p>main script:</p>
  
  <pre>
  ./expect.sh "ssh root@$SERVER1"  $SERVER1_PASS
  </pre>
  
  <p>error:</p>
  
  <pre>
  couldn't execute "{ssh root@xxx.xxx.xx.xxx}": no such file or directory
      while executing
  "spawn [lrange $argv 0 0]"
      (file "./expect.sh" line 2)
  </pre>
  
  <p>why?</p>