邮件功能

#!/bin/ksh
PATH=/usr/local/bin:/usr/bin:$PATH

. $HOME/utility/macro/macro.env

EMAIL_LST=$ADMIN_DIR/email.lst
#EMAIL_LST=$ADMIN_DIR/email.tst

for iname in `cat $EMAIL_LST`
do
        sed -e 's/$/            /g' $REPORT_DIR/chk_conn.log_`date '+%y%m%d'` >$REPORT_DIR/1
     /bin/mailx -s "Check database Connection Summary" $iname <  $REPORT_DIR/1
#     /bin/mailx -s "Check database Connection Summary" $iname <  $REPORT_DIR/chk_conn.log_`date '+%y%m%d'` 
done

FAQ:

stream editor for filtering and transforming text

-e script, --expression=script

       add the script to the commands to be executed

原文地址:https://www.cnblogs.com/feiyun8616/p/6026872.html