aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2012-05-08 11:11:20 +1200
committerTom Ryder <tom@sanctum.geek.nz>2012-05-08 11:11:20 +1200
commitae849d0a66b8ecfd168a06efaf13a2c63b5fb65c (patch)
tree2c0e6e8349719a9ca18c29f866810762b793f2f1
parentI've decided I don't like this. I don't mind typing ~/. (diff)
downloaddotfiles-ae849d0a66b8ecfd168a06efaf13a2c63b5fb65c.tar.gz
dotfiles-ae849d0a66b8ecfd168a06efaf13a2c63b5fb65c.zip
Check grep/ls --color options.
A few of the machines I work with are so old that they don't actually have the --color option.
-rw-r--r--bash/bashrc4
1 files changed, 2 insertions, 2 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 070f86ab..af5427ab 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -39,8 +39,8 @@ PS2='...'
# Use colors for ls and grep, if available.
if [ -x /usr/bin/dircolors ]; then
eval "$(dircolors -b)"
- alias ls='ls --color=auto'
- alias grep='grep --color=auto'
+ ls --help | grep -q -- --color && alias ls='ls --color=auto'
+ grep --help | grep -q -- --color && alias grep='grep --color=auto'
fi
# Use completion, if available.