Created
March 6, 2012 09:35
-
-
Save jabley/1985314 to your computer and use it in GitHub Desktop.
grep pipe filters broken on OSX Lion
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
#!/bin/sh | |
# Script to generate logging output | |
while true; do | |
echo $(date +%Y-%m-%dT%H-%M-%S) "WARN Here is a log message about events" | |
sleep 1; | |
done |
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
# Typically, this is since I'm tailing a log file and filtering out noise to get the lines that I'm interested in | |
$ ./generate_log > app.log& | |
$ tail -f app.log | grep events | |
2012-03-06T09-27-45 WARN Here is a log message about events | |
2012-03-06T09-27-46 WARN Here is a log message about events | |
2012-03-06T09-27-47 WARN Here is a log message about events | |
2012-03-06T09-27-48 WARN Here is a log message about events | |
$ tail -f app.log | grep WARN | |
2012-03-06T09-27-07 WARN Here is a log message about events | |
2012-03-06T09-27-08 WARN Here is a log message about events | |
2012-03-06T09-27-09 WARN Here is a log message about events | |
$ tail -f app.log | grep WARN | grep events | |
# Nothing! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment