Re: spawn and ssh problem
- From: Glenn Jackman <glennj@xxxxxx>
- Date: 8 Jul 2008 14:24:11 GMT
At 2008-07-08 10:15AM, "zhouvian@xxxxxxxxx" wrote:
I have the below codes to login a server
----------------------------------------------------------------
proc login {userId serverIp} {
spawn ssh -l $userId $serverIp
set prompt "(%|#|\\\\$)"
while {1} {
expect {
-nocase "password:" {
exp_send "123456\n"
}
-re $prompt {
return $spawn_id
}
eof {
puts "eof"
}
timeout {
puts "timout"
}
In the eof and timeout cases, you're still stuck in the infinite loop.
--
Glenn Jackman
Write a wise saying and your name will live forever. -- Anonymous
.
- References:
- spawn and ssh problem
- From: zhouvian
- spawn and ssh problem
- Prev by Date: spawn and ssh problem
- Next by Date: Re: spawn and ssh problem
- Previous by thread: spawn and ssh problem
- Next by thread: Re: spawn and ssh problem
- Index(es):
Relevant Pages
|