diff options
Diffstat (limited to 'bash/bashrc')
-rw-r--r-- | bash/bashrc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bash/bashrc b/bash/bashrc index 0f280084..169c6690 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -37,11 +37,13 @@ PS1='\u@\h:\w\$ ' PS2='...' # Use colors for ls and grep, if available. -if hash dircolors &>/dev/null; then +if ls --help | grep -q -- --color && hash dircolors &>/dev/null; then eval "$(dircolors -b)" - ls --help | grep -q -- --color && alias ls='ls --color=auto' + alias ls='ls --color=auto' +fi +if grep --help | grep -q -- --color; then + alias grep='grep --color=auto' fi -grep --help | grep -q -- --color && alias grep='grep --color=auto' # Use completion, if available. if [ -e /etc/bash_completion ]; then |