rss
Search : in
By : Relevance Date Username
Statut : Not resolved

Spawn, expect and send

hanees, on Tuesday May 20, 2008 12:42:02 PM
Hello,



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 xxxx

spawn 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 directory

so what should I do..
Need anyone advice..

Thanx so lot
Configuration: Windows XP
Internet Explorer 6.0
Reply to hanees  Report this message to moderators Go to last message

1


  • This message seems useful, vote!
  • Report this message to moderators
jipicy, on Tuesday May 20, 2008 06:34:01 PM
Hello,

Remove the first line "#/bin/sh" and add "-f" like that :
#!/usr/bin/expect -f
;-))
JP - Eleveur de pingouins -
Faites un geste pour l'environnement, fermez vos fenetres et adoptez un manchot.
Reply to jipicy

3


  • This message seems useful, vote!
  • Report this message to moderators
 pkl, on Wednesday June 4, 2008 03:46:10 AM
Hi Sir,

in my below command, it cannot work because of 2 problem

spawn ssh <xserver> <a command>
expect "password:"
send "$password\r"
expect eof

1)
I do not have /usr/lib/spawn /usr/lib/expect /usr/lib/send
I am looking for these files too.

2)
If you are in HP-UX, you probably get this error message and your <expect> will not work
/usr/lib/dld.sl: Can't find path for shared library: libtcl.sl
/usr/lib/dld.sl: No such file or directory

may anyone help.
I am not suppose to re-install the entire library but allow to copy and replace the corrupted files.

Please help me. thanks!
Reply to pkl
Relevant topic found in the forum
18/06 09h52Send me webmastering tips2
10/06 15h37Sending of Email from Excel Sheet2
26/05 12h11Expect Part II1
23/05 13h45Problem while sending mails1
More discussions about « Spawn, expect and send »
Software found in the relevant downloads
Download AxCrypt 1.6.4.4AxCrypt - AxCrypt is the leading open source file encryption software for Windows. It integrates seamlessly with Windows to encrypt,...Category: Encryption
License: Open Source
More freeware about « Spawn, expect and send »