From: Mark Wooding Date: Tue, 7 Jul 2009 18:21:50 +0000 (+0100) Subject: bashrc: `grep' hacking. X-Git-Url: https://git.distorted.org.uk/~mdw/profile/commitdiff_plain/a085e9a844a57d962cd5ce14d4e092b9592ee8cc?ds=sidebyside bashrc: `grep' hacking. Firstly, introduce `zgrep' to the ranks of hacked greps. Secondly, run results of `grep' through a pager. --- diff --git a/bashrc b/bashrc index fd91584..7f00141 100644 --- a/bashrc +++ b/bashrc @@ -119,7 +119,7 @@ export GREP_COLORS="mt=01;31:ms=01;31:mc=031;31:fn=36:ln=36:bn=36:se=34" greplike () { declare grep=$1; shift if [ -t 1 ]; then - command $grep ${GREP_COLORS+--color=auto} "$@" + command $grep ${GREP_COLORS+--color=always} "$@" | mdw-pager else command $grep "$@" fi @@ -127,6 +127,7 @@ greplike () { alias grep="greplike grep" alias egrep="greplike egrep" alias fgrep="greplike fgrep" +alias zgrep="greplike fgrep" # --- Set up some simple aliases ---