oracle@hostname:/home/oracle# cat /home/oracle/scripts/nc_profile.sh
for DB in `cat /home/oracle/SCRIPTS/lib/db_prod.lst`
do
echo "=========================================" > /home/oracle/notcomlog
echo "===============" >> /home/oracle/ncomply.log
echo $DB >> /home/oracle/ncomply.log
echo "===============" >> /home/oracle/ncomply.log
echo $DB >> /home/oracle/notcomlog
/home/oracle/scripts/nc_profile.sql $DB >> /home/oracle/ncomply.log
cat /home/oracle/ncomply.log | awk '{ print $1 "," $2}' >> /home/oracle/notcomlog
echo "=========================================" >> /home/oracle/notcomlog
mail -s "Non compliant profile as per WG policy $DB"myemail@emailhost.com < home/oracle/ncomply.log
rm /home/oracle/notcomlog
rm /home/oracle/ncomply.log
done
答案 0 :(得分:0)
bash for
循环,遍历每个$IFS
。默认情况下,该空白区域。
因此/home/oracle/SCRIPTS/lib/db_prod.lst
中的每一行 - $DB
都设置为该行的内容。然后循环运行到done
。