Quantcast
Channel: Active questions tagged expect - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 157

Using "expect" command to run an interactive program fails

$
0
0

I am trying to solve my question that I've asked here using expect script instead of file redirection. Unfortunately, this solution doesn't work as well (the same behaviour as described in the question above: I have to run the script below ./driver.exp multiple times to get the expected result.

Here is the error message:

... Input > QUITsend: spawn id exp4 not open    while executing"send "VOPT\n""    (file "./driver.exp" line 33)

(The full stdout output can be found here)

Here is my driver.exp file:

#!/usr/bin/expectspawn construct2dexpect "Input"send "naca0012.dat\n"expect "Command"send "SOPT\n"expect "Input"send "NSRF\n"expect "New value"send "80\n"expect "Input"send "RADI\n"expect "New value"send "1\n"expect "Input"send "NWKE\n"expect "New value"send "1\n"expect "Input"send "QUIT\n"expect "Command"send "VOPT\n"expect "Input"send "JMAX\n"expect "New value"send "1\n"expect "Input"send "YPLS\n"expect "New value"send "5\n"expect "Input"send "RECD\n"expect "New value"send "1E5\n"expect "Input"send "QUIT\n"expect "Command"send "GRID\n"expect "Input"send "SMTH\n"expect "Command"send "QUIT\n"interact

Could you please, help me understand why is this happening?

I appreciate your help


Viewing all articles
Browse latest Browse all 157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>