title: Expect: Prompt extending to next line
body: <p>I am trying to install a software which is a shell script file. I am using <strong>expect</strong> to do the silent installation.</p>
  
  <p>There is a strange line during the installation of the software where the prompt goes to the next line like this below.</p>
  
  <pre><code>ENTER AN ABSOLUTE PATH, OR PRESS &lt;ENTER&gt; TO ACCEPT THE DEFAULT 
    :
  </code></pre>
  
  <p>So I have tried with these 2 options, but it's NOT working!</p>
  
  <pre><code>1. expect  "    : " { send "/home/tester/IDir\r" }
  2. expect "ENTER AN ABSOLUTE PATH, OR PRESS &lt;ENTER&gt; TO ACCEPT THE DEFAULT\
        : " { send "/home/tester/IDir\r" }
  </code></pre>
  
  <hr>
  
  <p><strong>Expect File</strong></p>
  
  <pre><code>#!/usr/bin/expect -f
  #Taking arguments from test.sh file
  
  set File [lindex $argv 0]
  set IDir [lindex $argv 1]
  spawn sh /home/tester/$File 
  expect "PRESS &lt;ENTER&gt; TO CONTINUE: " { send "\n" }
  exp_internal 1
  expect -re "TO ACCEPT THE DEFAULT\r\n.*?:" { send "/home/tester/IDir\r" }
  #expect "      : " { send "/home/tester/IDir\r" }
  expect "IS THIS CORRECT? (Y/N): " { send "Y\n" }
  expect "PRESS &lt;ENTER&gt; TO CONTINUE: " { send "\n" }
  sleep 2
  expect "ENTER THE NUMBER OF THE DESIRED CHOICE: " { send "2\n" }
  expect "PRESS &lt;ENTER&gt; TO EXIT THE INSTALLER: " { send "\n" }
  sleep 2
  expect eof
  </code></pre>
  
  <hr>
  
  <p><strong>test.sh file</strong></p>
  
  <pre><code>dir=James/SDD
  cd /home/tester
  file=`ls | grep xx_yy*_linux_x86-64.bin`
  expect script.exp $file $dir
  </code></pre>
  
  <hr>