Last active
December 10, 2015 14:08
-
-
Save asross/4445325 to your computer and use it in GitHub Desktop.
A bash function which, for arguments foo, bar, and baz, evaluates $ grep foo | grep bar | grep baz
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
function cgrep { | |
local command="" | |
for var in "$@"; do | |
command+="grep $var | " | |
done | |
eval ${command% | } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment