~mdw
/
profile
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
93ba996
)
bashrc: Provide colour support for GNU grep.
author
Mark Wooding
<mdw@distorted.org.uk>
Mon, 22 Dec 2008 22:16:15 +0000
(22:16 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Mon, 22 Dec 2008 22:16:15 +0000
(22:16 +0000)
This is much more useful than it sounds.
bashrc
patch
|
blob
|
blame
|
history
diff --git
a/bashrc
b/bashrc
index
6759da7
..
3197bae
100644
(file)
--- a/
bashrc
+++ b/
bashrc
@@
-112,6
+112,18
@@
ls () {
fi
}
+# --- Some colour `grep' support ---
+
+export GREP_COLORS="mt=01;31:ms=01;31:mc=031;31:fn=36:ln=36:bn=36:se=34"
+
+grep () {
+ if [ -t 1 ]; then
+ command grep ${GREP_COLORS+--color=auto} "$@"
+ else
+ command grep "$@"
+ fi
+}
+
# --- Set up some simple aliases ---
alias cx='chmod a+x'