perl passwd 자동 입력

ITWeb/개발일반 2011. 9. 7. 14:16
  1. print "Enter Your Password: "; $oldpass = ;
  2. print "Enter Your New Password: "; $newpass = ;
  3.  
  4. open (PASSWD, "| passwd --stdin");
  5. print PASSWD "$oldpass";
  6. print PASSWD "$newpass";
  7. print PASSWD "$newpass";
  8. close(PASSWD);
: