Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am having trouble w/ this unix script:

Status
Not open for further replies.

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]
 
Is / the prompt for kirk? [sig]<p>Ged Jones<br><a href=mailto:gedejones@hotmail.com>gedejones@hotmail.com</a><br><a href= > </a><br>Top man[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top