#!/usr/bin/expect -f
### call with $username $passwd as arguments
set password [lindex $argv 1]
spawn /usr/bin/passwd [lindex $argv 0]
expect "*password:"
send "$password\r"
expect "*password:"
send "$password\r"
expect eof
2007-02-02
expect
The command expect is a useful tool to script otherwise nonscriptable unix tools, e.g. passwd:
Abonnieren
Posts (Atom)