title: expect command - Unix
body: <p>I am using 'expect' to automate ssh password authentication. When I run the script in SunOS, I find the spawned ssh process gets killed once the below script is completed. This is not the case in Linux. How do we avoid it? Should we ignore the SIGCHLD signal somehow?
  Is there anyway to determine through this script if spawned process is successful and report error if any?</p>
  
  <pre><code>#!/usr/local/bin/expect -f
  
  set password blah-blah
  spawn ssh -NfL 8002:&lt;test domain&gt;:22 test@testdomain.com
  expect "* password:*"
  send -- "$password\r"
  send -- "\r"
  expect EOF
  </code></pre>
  
  <p>-Karthik</p>