title: expect utility is not working when executing from jenkins
body: <p>we have a unix script which uses expect utility for interactive execution. This script works well when we run from unix server.</p>
  
  <p>If we run this script from Jenkins, it is not working.</p>
  
  <p>Below is the script</p>
  
  <pre><code>var="xxxxx"
  expect -c "
      spawn sudo cp /abcd/sjws/config/obj.conf /abcd/sjws/config/obj.conf_jenkins
      expect {
      "Password:" { send $var\r;interact }
      }
      exit
      "
  </code></pre>
  
  <p>Below is the output when we run from jenkins</p>
  
  <pre><code>spawn sudo cp /abcd/sjws/config/obj.conf /abcd/sjws/config/obj.conf_jenkins 
  Password: 
  Password:
  Build step 'Execute shell' marked build as failure 
  Finished: FAILURE
  </code></pre>