este script verifica a linha numérica de /tmp/my.log e, se for maior ou igual a 20, enviará um e-mail
#!/bin/bash
FILE_NAME=/tmp/my.log
NUM_OF_LINES=$(wc -l < ${FILE_NAME})
if [ "${NUM_OF_LINES}" -ge "20" ]
then
echo "Triggering Email"
mail -s "Log" [email protected] < "${FILE_NAME}"
else
echo "Log file contains ${NUM_OF_LINES} lines"
fi