In a bash script, I'm using wine to call a DOS program that requires me to "Press Enter to exit". How do I do that automatically and continue with the rest of the script?
A:
You might be able to use the expect
program.
Here is an example script:
spawn /path/to/program/Dynamips
expect -- "->"
send "start R1\r"
expect -- "->" {
sleep 5
send "start R2\r"
}
expect eof
You can invoke this with:
expect scriptname
Dennis Williamson
2009-08-28 23:00:25