Skip to content

Instantly share code, notes, and snippets.

@drldcsta
Created September 26, 2013 03:59
Show Gist options
  • Save drldcsta/6709729 to your computer and use it in GitHub Desktop.
Save drldcsta/6709729 to your computer and use it in GitHub Desktop.
#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