Quote:
Originally Posted by wjevans_7d1@yahoo.co
I'm not sure exactly what you're trying to say, but try this command at the shell prompt:
man expect
Hope this helps.
|
This is what I have been looking for
Next problem.. This is my simple expect input file..
spawn screen /dev/ttyS0
send "ATE"
expect "OK"
send "at+cmgf=1"
expect "OK"
exp_eof
Problem is that screen is started, but something goes wrong. The ATE command is sent just fine, but i never gets an "OK" and thus times out.
this is the output of expect -d [file]
expect: does "ATE\u001b[?1049h\u001b[r\u001b[m\u001b[2J\u001b[H\u001b[?7h\u001b[?1;4;6l\u001b[4l\u001b[?1h\u001b=\u001b[0m\u001b(B\u001b[1;39r\u001b[H\u001b[2J\u001b]2;[screen -] \u0007\u001b[H\u001b[2J\u001b]2;screen\u0007\u001b]2;[screen 0: ttyS0] \u0007" (spawn_id exp4) match glob pattern "OK"? no
expect: timed out
send: sending "at+cmgf=1" to { exp4 }
expect: does "ATE\u001b[?1049h\u001b[r\u001b[m\u001b[2J\u001b[H\u001b[?7h\u001b[?1;4;6l\u001b[4l\u001b[?1h\u001b=\u001b[0m\u001b(B\u001b[1;39r\u001b[H\u001b[2J\u001b]2;[screen -] \u0007\u001b[H\u001b[2J\u001b]2;screen\u0007\u001b]2;[screen 0: ttyS0] \u0007" (spawn_id exp4) match glob pattern "OK"? no
expect: timed out
invalid command name "exp_eof"
while executing
"exp_eof"
(file "in" line 6)
(I know about the eof error..)
If I enter the commands manually screenlog.0 gives this:
[bubba@jupiter ~]# cat screenlog.0
OK
OK
OK
[bubba@jupiter ~]#
But if I use expect, screenlog.0 is empty