-
-
Save henrik/476573 to your computer and use it in GitHub Desktop.
grep that doesn't wait forever for STDIN with unspecified filename.
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
# Call grep, with stdin closed if it is a terminal. | |
# | |
# Avoids the "eternal wait" problem when you've forgotten | |
# to specify a filename. | |
function grep { (tty -s && exec <&-; $(which grep) $@); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment