|
Expect Scripting help - escape characters
Hello,
I'm having an issue with scripting expect and I was hoping someone could help me out. I'm scripting a telnet session connect, and I can't get the "expect" command to work correctly on the prompt, which is "~ $ ".
I think expect is getting confused by the $.
Heres the script:
#!/usr/bin/expect -f
set timeout 10
spawn telnet $argv
expect "login:"
send "mylogin\n"
expect "Password:"
send "mypass\n"
expect "~ $ "
# Send some commands
close
I've tried expect "~ \$", expect \$ and a few other escape permutations but the script just stops working after the prompt comes up. Thanks for any help!
|