tags:

views:

241

answers:

3

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: 

Send it the input 0x0D

Rushyo
+2  A: 

echo | wine dosprogram.exe

moonshadow
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