root/bin/passwd_expect.sh
| Revision 11, 198 bytes (checked in by jhthorsen, 15 months ago) |
|---|
| Line | |
|---|---|
| 1 | #/bin/sh |
| 2 | |
| 3 | exec expect -f "$0" ${1+"$@"} |
| 4 | set password [lindex $argv 1] |
| 5 | spawn passwd [lindex $argv 0] |
| 6 | |
| 7 | sleep 1 |
| 8 | |
| 9 | expect "assword:" |
| 10 | send "$password\r" |
| 11 | |
| 12 | expect "assword:" |
| 13 | send "$password\r" |
| 14 | |
| 15 | expect eof |
| 16 |
Note: See TracBrowser
for help on using the browser.
