By SkySmart
Code:
egrep -v "#" ${SERVERS} | while read shosts
do
grep -Pi "[a-z]|[A-Z]" ${LOGFILE} | egrep "${snhosts}" | egrep "NOTIFICATION:" | awk -F";" '{print $3}' | sort -n | uniq | while read CEXIST
do
if [ "$CEXIST" = "$rcheckname" ] ; then
echo "$CEXIST"
fi
done
done
is there a better way to rewrite the above code? im guessing there’s some awk magic out there that could work here?
Source: The UNIX and Linux Forums