X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/bf3f5761d2d29ac657c5612913b02497c9686e3b..150acf6735d16c63bf3eef6a1ac4ab4cbc4a0ba7:/bashrc diff --git a/bashrc b/bashrc index 3197bae..7f4cd74 100644 --- a/bashrc +++ b/bashrc @@ -116,13 +116,17 @@ ls () { export GREP_COLORS="mt=01;31:ms=01;31:mc=031;31:fn=36:ln=36:bn=36:se=34" -grep () { +greplike () { + declare grep=$1; shift if [ -t 1 ]; then - command grep ${GREP_COLORS+--color=auto} "$@" + command $grep ${GREP_COLORS+--color=auto} "$@" else - command grep "$@" + command $grep "$@" fi } +alias grep="greplike grep" +alias egrep="greplike egrep" +alias fgrep="greplike fgrep" # --- Set up some simple aliases ---