expect gets hung
From: Mohammed Riyaz (p_mdriyaz_at_sify.com)
Date: 12/31/04
- Previous message: Ramon Ribó: "Re: Regular-expression search: escaping characters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 Dec 2004 04:48:50 -0800
Hi,
I am having problems with a simple expect program for passwd.
#!/usr/bin/expect
spawn passwd [lindex $argv 0]
set password [lindex $argv 1]
expect "*password:"
send "$password \r"
expect "*password:"
send "$password \r"
expect eof
when i run this program with ./test riyaz 7sd8990ad
i get the following output
spawn passwd riyaz
Changing password for user riyaz.
New password: 7sd8990ad
Retype new password:
$
after displaying New password: 7sd8990ad the program waits for
sometime (a couple of seconds) and then Retype new password appears
and then again waits for sometime and then the prompt appears. But the
password does not change. Could somebody help me out with this.
i even tried with #!/usr/bin/expect -f, i also tried with \n instead
of \r
i am using version 5.39.0
Thank you,
Mohammed Riyaz P.
- Previous message: Ramon Ribó: "Re: Regular-expression search: escaping characters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|