Re: another expect question



The original script as presented worked fine.

However, I have made the suggested changes and the password is still printed
to my screen. The script is now:

log_user 0
spawn ssh -l root kull
expect "word:"
send "password\r"
expect -re ".*"
interact



"Uwe Klein" <uwe_klein_habertwedt@xxxxxxxxxxx> wrote in message
news:0e40g3-nse.ln1@xxxxxxxxxxxxxxxxxxxxxxx
gbarn wrote:
The script is very simple.....
........tooo simple ;-)

log_user 0
spawn ssh -l root system_name
# ssh sends the password request , then
# flushes all input and switches to nonecho mode
# in preparation for the password input from the user
# place here:
expect "word: "
# youve seen the query now you may:
send "password\r"


> expect "*"
# this call will expect exactly one "*"
# not all output upto now
# what you want is

expect -re ".*"

interact

I would like to stop the password from being printed to the screen.
what happens for you is :
you start ssh
you send a password

and no output is ever matched, all is still in the queue.

interact dumps all of that into your lap


uwe


.