problem....

--===============1386700640==
Content-Type: multipart/alternative;
boundary="_4868531a-c2bb-426c-b649-c522052aefdf_"

--_4868531a-c2bb-426c-b649-c522052aefdf_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Hello,

i am sorry to put this 'expect' issue here on perl list. But i searched the=
internet for so long and expect manual too, but couldn't get the cause of =
the following behavior:


i would appreciate all help.

in the following code no matter what the spawned command (ssh <hostname>) s=
ends back (normally a string: Password: ) the last procedure is getting exe=
cuted by the script...

I am so confused it looks a simple code otherwise...

can anyone tell me why is this behaving like that?

##################
# end supporting functions
#################

set host [lindex $argv 0]
set pass [lindex $argv 1]
set prompt "(%|\$|#|>)"


spawn /usr/local/bin/ssh $host
expect {
-re "yes" {
send -- "yes\r"
expect {
-re $prompt { hostok $host }
-re "(P|p)assword:" { sendpass $pass $host $prompt =
}
}
}
-re "(P|p)assword:" {
sendpass $pass $host $prompt
}
-re "$prompt" { hostok $host } <<<This procedure is getting e=
xecuted no matter what
}
exit 0
expect eof




thanks in advance.

-RP
__________________________________________________
There are as many paths as there are travellers...
____________________________________________________________ _____
The best games are on Xbox 360. Click here for a special offer on an Xbox =
360 Console.
http://www.xbox.com/en-US/hardware/wheretobuy/=

--_4868531a-c2bb-426c-b649-c522052aefdf_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style>
..hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class=3D'hmmessage'>
<style>.hmmessage P{margin:0px;padding:0px}body.hmmessage{FONT-SIZE: 10pt;F=
ONT-FAMILY:Tahoma}</style>Hello,<br><br>i am sorry to put this 'expect' iss=
ue here on perl list. But i searched the internet for so long and expect ma=
nual too, but couldn't get the cause of the following behavior:<br><br><br>=
i would appreciate all help.<br><br>in the following code no matter what th=
e spawned command (ssh <hostname>) sends back (normally a string: Pas=
sword: ) the last procedure is getting executed by the script...<br><br>I a=
m so confused it looks a simple code otherwise...<br><br>can anyone tell me=
why is this behaving like that?<br><br>##################<br># end support=
ing functions<br>#################<br><br>set host [lindex $argv 0]<br>set =
pass [lindex $argv 1]<br>set prompt "(%|\$|#|>)"<br><br><br>spawn /usr/l=
ocal/bin/ssh $host<br>expect {<br>       =
; -re "yes" {<br>         &nbs=
p;      send -- "yes\r"<br>    =
;            expect =
{<br>           &nbs=
p;            -re $p=
rompt { hostok $host }<br>        &=
nbsp;           &nbs=
p;   -re "(P|p)assword:" { sendpass $pass $host $prompt }<br>&nbs=
p;            &=
nbsp;          }<br> &nbs=
p;            &=
nbsp; }<br>        -re "(P|p)assword:" {=
<br>            =
;     sendpass $pass $host $prompt<br>   =
;             }=
<br>        -re "$prompt" { hostok $host=
}       <<<This procedure is gettin=
g executed no matter what<br>}<br>exit 0<br>expect eof<br><br><br><br><br>t=
hanks in advance.<br><br>-RP<br>___________________________________________=
_______<br>There are as many paths as there are travellers...
<hr />Th=
e best games are on Xbox 360. Click here for a special offer on an Xbox 36=
0 Console. <a href=3D'http://www.xbox.com/en-US/hardware/wheretobuy/' targe=
t=3D'_new'>Get it now!</a></body>
</html>=

--_4868531a-c2bb-426c-b649-c522052aefdf_--

--===============1386700640==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1386700640==--
Rajeev Prasad [ Fr, 14 Dezember 2007 04:40 ] [ ID #1889113 ]

RE: problem....

From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of Rajeev
Prasad
Sent: 14 December 2007 03:40
To: activeperl [at] listserv.activestate.com
Subject: problem....

> Hello,
> =

> i am sorry to put this 'expect' issue here on perl list. But i
searched the internet for so long and expect =

> manual too, but couldn't get the cause of the following behavior:

expect is essentially tcl, so you might get a better response on a tcl
forum. In fact Activestate host a number of mailing lists concerning
tcl, even one related to expect. For example, see
http://aspn.activestate.com/ASPN/Mail/?topic=3DTcl.

HTH

-- =

Brian Raven =



=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Atos Euronext Market Solutions Disclaimer
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

The information contained in this e-mail is confidential and solely for the=
intended addressee(s). Unauthorised reproduction, disclosure, modification=
, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediat=
ely and delete it from your system. The views expressed in this message do =
not necessarily reflect those of Atos Euronext Market Solutions.

Atos Euronext Market Solutions Limited - Registered in England & Wales with=
registration no. 3962327. Registered office address at 25 Bank Street Lon=
don E14 5NQ United Kingdom. =

Atos Euronext Market Solutions SAS - Registered in France with registration=
no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 750=
09 Paris France.

L'information contenue dans cet e-mail est confidentielle et uniquement des=
tinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Tou=
te copie, publication ou diffusion de cet email est interdite. Si cet e-mai=
l vous parvient par erreur, nous vous prions de bien vouloir prevenir l'exp=
editeur immediatement et d'effacer le e-mail et annexes jointes de votre sy=
steme. Le contenu de ce message electronique ne represente pas necessaireme=
nt la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Soci=E9t=E9 de droit anglais, enregi=
str=E9e au Royaume Uni sous le num=E9ro 3962327, dont le si=E8ge social se =
situe 25 Bank Street E14 5NQ Londres Royaume Uni.

Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e, e=
nregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro 4=
25 100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard Hauss=
mann 75009 Paris France.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Brian Raven [ Fr, 14 Dezember 2007 11:27 ] [ ID #1889114 ]
Perl » gmane.comp.lang.perl.active-perl » problem....

Vorheriges Thema: creating an executable
Nächstes Thema: Fw: Next version of perl?