scan-cc-user.sh
#! /bin/sh export LC_ALL=zh_CN.UTF-8 cd /bin2/ sh scan-cc-user-daily.sh > scan-cc-user-daily.sh.log 2>&1 /usr/bin/mutt -s "scan-cc-user-daily" scm-svr-mtr@scm5.***.cn < scan-cc-user-daily.sh.log
scan-cc-user-daily.sh
#!/bin/sh if [ -f scan-cc-user3.txt ] then rm -f scan-cc-user3.txt fi if [ -f scan-cc-user1.txt ] then rm -f scan-cc-user1.txt fi find /cruisecontrol/projects/ -name "*.xml" -exec grep 'mailto.*@.*' {} ; > scan-cc-user1.txt sed -i 's/(.*)"(.*)"(.*)/2/g' scan-cc-user1.txt sort scan-cc-user1.txt | uniq - scan-cc-user3.txt echo "***账号总数***" cat scan-cc-user3.txt | wc -l echo "." echo "***字母大写的账号***" grep [A-Z] scan-cc-user3.txt echo "." echo "***账号变化***" diff scan-cc-user3.txt scan-cc-user.txt cat scan-cc-user3.txt > scan-cc-user.txt echo "." echo "***帐号不是集团的邮箱***" grep -v -E '@scm5.***.cn$|@***.com$|@***.com$|@***.com$|@***.com$|@***.com$|@***.com|@***.cn$|@***.com$|@***.cn$|@***.com$|@***.com$|@***.com.cn$|@***.com$|@***.cn$|@***.com$' scan-cc-user.txt