I am VERY new to awk, and trying to use it to parse out a log file. The file contains information of flash version, if installed. The line I'm looking for is like:
Fri Apr 8 11:38:39 EDT 2016: Current Flash version: noflash
So I wrote a script to search:
#!/bin/bash
NOFLASH=`awk -F ' ' '($2 == "Apr") && ($3 == "8") && ($10 == "noflash") { print $10 }' /Library/Logs/FlashUpdateScript.log`
if [ "$NOFLASH" = *noflash* ];then
echo "Flash not installed on Apr 8"
else echo "Flash was installed on Apr 8"
fi
The problem is that there can be multiple lines that contain Apr 8 and noflash, so in those cases, it's not returning the "Flash not installed" value I'm looking for. How do I edit this script so I can tell if flash wasn't installed on Apr 8?