title: python pexpect using spawn to run a bash file in sonic unit
body: <pre><code>import pexpect
  child = pexpect.spawn(&quot;/bin/bash&quot;, ['/home/admin/eeprom_test_01.sh'])
  child.expect(&quot;Type 'Continue' to proceed, else abort:&quot;)
  child.sendline(&quot;Continue&quot;)
  child.expect(&quot;Select Capitaine revision\\(EVT or DVT\\):&quot;)
  child.sendline(&quot;DVT&quot;)
  child.expect(&quot;EEPROM Device: COMe&quot;)
  return child
  </code></pre>
  <p>This is the error received,</p>
  <h2>EOF: End Of File (EOF). Exception style platform.
  &lt;pexpect.pty_spawn.spawn object at 0x7fa381be9978&gt;
  command: /bin/bash
  args: ['/bin/bash', '/home/admin/eeprom_test_01.sh']
  buffer (last 100 chars): b''
  before (last 100 chars): b'/bin/bash: /home/admin/eeprom_test_01.sh: No such file or directory\r\n'
  after: &lt;class 'pexpect.exceptions.EOF'&gt;
  match: None
  match_index: None
  exitstatus: 127
  flag_eof: True
  pid: 16303
  child_fd: 7
  closed: False
  timeout: 30
  delimiter: &lt;class 'pexpect.exceptions.EOF'&gt;
  logfile: None
  logfile_read: None
  logfile_send: None
  maxread: 2000
  ignorecase: False
  searchwindowsize: None
  delaybeforesend: 0.05
  delayafterclose: 0.1
  delayafterterminate: 0.1
  searcher: searcher_re:
  0: re.compile(b&quot;Type 'Continue' to proceed, else abort:&quot;)</h2>