Re: [Expect] Need to have explanations for the use of the expect command
- From: Glenn Jackman <xx087@xxxxxxxxxxxxxxxxxxx>
- Date: 15 Mar 2006 17:20:06 GMT
At 2006-03-15 11:42AM, Andrew Falanga <not_real@xxxxxx> wrote:
#! /usr/bin/expect
set host [lindex $argv 0]
Try adding here:
exp_internal 1
spawn ssh root@$host "cd logs; ls"
expect {
-re password { sleep 1; exp_send "password\r" }
}
Actually, that's not just basically the script, it is the script. As
far as I can tell, this isn't working. The script does spawn the ssh
process, but when the prompt comes for root's password, it just sits
there for 5 or 10 seconds and then, apparently, times out.
There will be copious output, but look for something like:
did <big long string> match 'password'? no
You may not be expecting the right thing.
--
Glenn Jackman
Ulterior Designer
.
- References:
- [Expect] Need to have explanations for the use of the expect command
- From: Andrew Falanga
- [Expect] Need to have explanations for the use of the expect command
- Prev by Date: Re: Help with regsub: commas
- Next by Date: Re: [Expect] Need to have explanations for the use of the expect command
- Previous by thread: Re: [Expect] Need to have explanations for the use of the expect command
- Next by thread: Re: [Expect] Need to have explanations for the use of the expect command
- Index(es):
Relevant Pages
|