Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi, need help..
i have file to doing telnet to some address but it doesn't work..where is the mistake :#/sbin/sh
#!/usr/bin/expect#Var_Glob
set myServ 192.x.x.x
set myPass1 xxxxspawn telnet $myServ
expect "password:"# Send the password, and then wait for a shell prompt
send "$myPass1\r"send command
send "quit\r"
expect eof#end file
but after I excute I got mistake message:
spawn: command not found
couldn't read file "password:": no such file or directory
send: command not found
send: command not found
couldn't read file "eof": no such file or directoryso what should I do..
Need anyone advice..Thanx so lot
BEST REGARDS
ADRIAN

First, since this is an expect script, I'd remove this:
#/sbin/sh
Whatever your shell invocation is - expect in this case - always make sure that it's on line 1 beginning in column 1:
#!/usr/bin/expect
Second, you are getting this error because expect doesn't recognize what "command" is. I certainly don't see where command is defined in the script.

![]() |
VMware Workstation 6 over...
|
Linux installation proble...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |