urello
1
Hi.
Here is beginning of my script
#!/usr/local/bin/expect --
set timeout 15
spawn /usr/local/account.sh -n modify
expect "Password:" {send "mypassword\r"}
But due to some terminal control sequences (or something else, dunno exactly) my password prompt is looking like this:
[[61;157R-n Password:
and expect doesn't recognize it. I tried to use "expect -re" instead of "expect" but no luck. Pls help. OS - Solaris 8
You may want to try autoexpect to find out how to "expect" the password prompt - autoexpect. This comes with the expect installation.
urello
3
Thanks, this is helpful, but i'd like to get assisted with regexp composing rather then get solution for particular case from autoexpect.
urello
4
Pls help me with regexp. Autoexpect-generated sample looks pretty weird and is not working for me
expect -exact "sh: /usr/local/bin/stty: not found\r
[r[999;999H[6n"
send -- "[61;157R"
[r[999;999H[6n"
send -- "[61;157R"
-n Password: \r
"