title: Expect Script to wait for specific input for a certain amount of time
body: <p>I'm working on Installation of a windows application via docker, which requires some user inputs like DB setup, etc. I'm using expect script for these user inputs to automate our installation. </p>
  
  <p>But during the final step, My installation takes upto 15-20 mins as the application needs to install the DB schema and other required elements and then gives final input to press enter to exit the installation process.</p>
  
  <p>How do I handle it, currently I'm just making my expect script to wait, but is there anyway for me to handle this and make expect script wait for that specific input "string match"? </p>
  
  <p>here is how my expect script looks like </p>
  
  <pre><code>    #!/bin/bash
  
  expect -c '
    spawn sh ./setupapp.sh
    expect "PRESS &lt;ENTER&gt; TO CONTINUE:"
    send "\r"
    expect "PRESS &lt;ENTER&gt; TO CONTINUE:"
    send "\r"
    expect "PRESS &lt;ENTER&gt; TO CONTINUE:"
    send "\r"
    expect "PRESS &lt;ENTER&gt; TO CONTINUE:"
    send "\r"
    expect "PRESS &lt;ENTER&gt; TO CONTINUE:"
    send "\r"
  expect "PRESS &lt;ENTER&gt; TO CONTINUE:"
    send "\r"
    expect "Waiting here:"
    send "\r"
    expect "Waiting here:"
    send "\r"
    expect "Waiting here:"
    send "\r"
    expect "Waiting here:"
    send "\r"
    expect "Waiting here:"
    send "\r"
    expect "Waiting here:"
    send "\r"
   expect "PRESS &lt;ENTER&gt; TO Exit Installation:"
   send "\r"
    expect eof
  '
  </code></pre>
  
  <p>I'm using Waiting here so that it wait for 10 seconds, is there any way that I can automate and wait for the last string Press Enter to Exit the Installation.</p>
  
  <p>Thanks!</p>