pmcmicha
Technical User
- May 25, 2000
- 353
I am using a Unix(Korn Shell) system and the current script is not working properly. Here is an example of what is happening along w/ the script.
go 8559
telnet> open s85591.com
Trying (an ip)...
Connected to s85591.com.
Escape character is '^]'.
UnixWare 2.1.2 (S85591) (pts/0)
login:
This is where the problem starts. The script will not send the login name, instead I get the following:
login: telnetd: Unable to invoke login scheme.
Connection closed by foreign host.
invalid command name "
expect "login:"
send "kirk\r"
expect "password:"
send "kirk1\r"
expect "/"
"
while executing
"{
expect "login:"
send "kirk\r"
expect "password:"
send "kirk1\r"
expect "/"
} "
(file "go" line 13)
The problem always lies at line 12 or 13; here is the script so far:
#!/usr/local/bin/expect --
spawn -noecho telnet
expect "telnet"
send "open s"
send "$argv"
send "1.com\r"
set timeout -1
expect {
"connected"
}
{
expect "login:"
send "kirk\r"
expect "password:"
send "kirk1\r"
expect "/"
}
Any help would be appreciated. I did try to just have one set of {} instead of two, but that came up w/ even more problems. Thanks. [sig][/sig]
go 8559
telnet> open s85591.com
Trying (an ip)...
Connected to s85591.com.
Escape character is '^]'.
UnixWare 2.1.2 (S85591) (pts/0)
login:
This is where the problem starts. The script will not send the login name, instead I get the following:
login: telnetd: Unable to invoke login scheme.
Connection closed by foreign host.
invalid command name "
expect "login:"
send "kirk\r"
expect "password:"
send "kirk1\r"
expect "/"
"
while executing
"{
expect "login:"
send "kirk\r"
expect "password:"
send "kirk1\r"
expect "/"
} "
(file "go" line 13)
The problem always lies at line 12 or 13; here is the script so far:
#!/usr/local/bin/expect --
spawn -noecho telnet
expect "telnet"
send "open s"
send "$argv"
send "1.com\r"
set timeout -1
expect {
"connected"
}
{
expect "login:"
send "kirk\r"
expect "password:"
send "kirk1\r"
expect "/"
}
Any help would be appreciated. I did try to just have one set of {} instead of two, but that came up w/ even more problems. Thanks. [sig][/sig]