Created
September 26, 2013 03:59
-
-
Save drldcsta/6709729 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Notes in response to http://bit.ly/1fFMKIx (really cool blog) | |
output=$(fgrep -c CRON /var/log/messages) #grave accent notation is depreciated | |
##no reason for 2 pipes when 0 will do | |
#if you're not using regex, use fgrep | |
if [[ -n ${output} ]];then #we can avoid the `local` issue by just checking the existence | |
echo "Found ${output}..." #of output | |
#exit 0 #you can set your exit status explicitly, but not a big deal | |
else | |
echo "No instances of..." | |
#exit 1 | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment