[ale] scripting passwd change

Michelangelo Grigni mic at mathcs.emory.edu
Wed Aug 23 17:08:28 EDT 2000


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.





More information about the Ale mailing list