一、有关用户密码的修改管理:

  1 #!/bin/bash
  2 # Description:
  3 # Date:   2010-12-25 10:04:00
  4 # Auth:
  5 #

  6
  7 [ ! $USER='root' ] && echo "Only root can execute " && exit 1
  8
  9 FILE='/etc/shadow'
 10 let TODAY=$[`date +"%s"`/86400]
 11
 12 if [ -e $FILE ]; then
 13   while read LINE; do
 14     USERNAME=`echo $LINE | cut -d: -f1`
 15     let MD=`echo $LINE | cut -d: -f5`
 16     [ $[$MD - $TODAY] -lt 10 ] && echo "${USERNAME}'s password need to change."
 17   done < $FILE
 18 fi