| Last published: Wed Oct 8 10:18:30 MDT 2003 | Doc for 1.1.4.1 |
|
Programmer's Reference
COE_API:COE
COE_API:OS_Linux
COE_API:OS_Windows
COE_API:UAM
COE_API:UserMgmt
COE_CVS
COE_ManPages:COE
COE_ManPages:UserMgmt
COE:SegmentationGuide
|
#!/usr/bin/expect -f
# wrapper to make passwd(1) be non-interactive
# username is passed as 1st arg, passwd as 2nd
set password [lindex $argv 1]
spawn /usr/bin/sudo /usr/bin/passwd [lindex $argv 0]
expect "Enter new UNIX password: "
sleep 2
send "$password\r"
expect "Retype new UNIX password: "
sleep 2
send "$password\r"
expect eof
|
| © 2003, Federal Linux Systems |