git://git.iain.cx/iain
/
profile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
41bfbf5
)
Handle case where tput doesn't work.
author
Iain Patterson
<me@iain.cx>
Wed, 4 Nov 2009 17:19:15 +0000
(17:19 +0000)
committer
Iain Patterson
<me@iain.cx>
Wed, 4 Nov 2009 17:19:15 +0000
(17:19 +0000)
.profile.d/grep.bashrc
patch
|
blob
|
history
diff --git
a/.profile.d/grep.bashrc
b/.profile.d/grep.bashrc
index
0872828
..
04bd1d8
100644
(file)
--- a/
.profile.d/grep.bashrc
+++ b/
.profile.d/grep.bashrc
@@
-9,6
+9,7
@@
if grep -V 2>/dev/null | grep GNU >/dev/null; then
# cx: Lines of context; sl: Matching lines; mt: Search string; fn: Filename
# ln: Line number; bn: Byte offset; se: Separators.
colours=$(tput colors 2>/dev/null)
+ [ -z "$colours" ] && colours=0
if [ $colours = 256 ]; then
export GREP_COLORS='cx=38;5;246:sl=:mt=33:fn=38;5;25:ln=38;5;82:bn=33:se=38;5;246'
elif [ $colours -gt 88 ]; then