#!/bin/sh touch testlist cat /dev/null > testlist grep "=" passwd |grep -v "#"|grep -v "admin" > testlist cat testlist |tr -s [:space:] > list.conf rm -rf testlist user_list=`grep "=" list.conf |awk -F'=' '{print $1}'` for i in $user_list; do pass=`grep $i list.conf |awk -F'=' '{print $2}'` echo "svn://xxx:xxx USER : $i PASSWORD : "$pass |mail -s "【阅】svn" $i'@xxx.com' done
0 0 * * 0 sh sendPass.sh 每周日凌晨发送