Hi Folks
I am having problems with a simple expect script. The contents are
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#!/usr/bin/expect -f
set addy devmachine
set user devuser
set password PASSWORD
spawn telnet -l $user $addy
expect "user name:"
send "$user\r"
expect "password:"
send "$password\r" (1)
interact (2)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
this works fine. When I want to set up some environment variables and a
few other things between (1) and (2),
ie
[snip]
expect "devmachine:" #looking for the command prompt
send "resize\r"
[snip]
the script always logs on ok, then it stalls for about 10 seconds with
the message of the day followed by
^[[13;80R
after this annoying pause I eventually get the command prompt without
any of my commands being run. I have tried putting a sleep 3 between
(1) and (2) but it doesnt seem to help.
Can someone please suggest how I might fix this.
Cheers
Tony
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug