Created
December 16, 2013 17:04
-
-
Save greyaperez/7990423 to your computer and use it in GitHub Desktop.
Logging - with filtering
This file contains hidden or 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
# Tail Files in Directory | |
# USAGE: $ log {arg1:file filter(opt)} {arg2:string filter(opt)} | |
function log (){ | |
if [ $# -lt 1 ]; | |
then | |
tail -f * | |
fi | |
if [ $# -gt 1 ]; | |
then | |
tail -f $1 | grep --line-buffered "$2" | |
else | |
tail -f $1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment