[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] scripting passwd change



pynk wrote:
> On Tue, 22 Aug 2000, Joe Knapka wrote:
> > #!/usr/bin/expect
> > spawn passwd
> > expect "ssword:"
> > send [lindex $argv 0]
> > expect "ssword:"
> > send [lindex $argv 1]
> > expect "ssword:"
> > send [lindex $argv 1]
> > expect eof
> 
> I can't get this to work for some reason....
> $ ./cpasswd.tcl
> spawn passwd
> Changing password for pynk
> (current) UNIX password: 
> 
> ...and then it sits there and looks at me until it finally times out.  

That script is not sending the \r (return key) at the end
of each password.  Something like this should help:

expect "ssword:"
send [lindex $argv 0]\r
expect "ssword:"
send [lindex $argv 1]\r
expect "ssword:"
send [lindex $argv 1]\r
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.