改变用户密码的脚本

#!/usr/bin/expect -f
set user [lindex $argv 0]
set newpwd [lindex $argv 1]
set timeout 10
spawn passwd $user
expect "*password:" {send "$newpwd\r"}
expect "*password:" {send "$newpwd\r"}
expect eof
exit

 

posted @ 2016-10-09 14:41  cphmvp  阅读(174)  评论(0编辑  收藏  举报
爬虫在线测试小工具: http://tool.haoshuju.cn/