I know the website your following, but they have the code wrong.
1st) remove the interact , because the interact should follow some string, read the man page for more.
2nd) you need to set the expect buffers then use puts to echo them to the screen, thats why you get the error no matched entries found.
3rd) If you have expect(0,string) set and puts to print, then this will only work if some part of the string entered matches some part of what was expected.
so this should work.
Quote:
#!/usr/bin/expect
set timeout 20
spawn "./echo.sh"
expect "Hello"
set dif $expect_out(buffer)
puts "this is what you expexted $dif "
|
The above script will work if what was ran by the script echo.sh has the word "Hello" (case sensitive).If not then it will just echo what was not entered.