#!/usr/expect/bin/expect
spawn /usr/bin/passwd [lindex $argv 0]
set password [lindex $argv 1]
expect "*UNIX password:"
#sleep .1
send "$password\n"
expect "*new UNIX password:"
send "$password\n"
expect eof
#!/bin/bash
./ex.sh vpopmail passwd >/dev/null
sed -i '/password changed for vpopmail/d'
阅读(441) | 评论(0) | 转发(0) |