find . -name 'Email*.log' -exec grep -il 'bad password' {} \;| while read line; do
TEMPNUM=`tail -20 $line | grep 'bad password' | wc -l`
if [ $TEMPNUM -gt 0 ]; then
awk '/Username/{print $NF}' $line >> expiredmailbox.txt
fi
done
This is the code I used and ran the shell script. I am getting
line 6: syntax error near unexpected token `done'
Even if just try to echo the $line. I am getting an error. How can I eliminate this?