aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-06-19 14:19:08 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-06-19 14:19:08 +1200
commit9a5d6d9f9d5361187e904f937af3cabd1e1071ca (patch)
tree7e01e8011756787c4e5af6a1148bd976556175d6 /sh
parentDon't bother checking for grep --color (diff)
downloaddotfiles-9a5d6d9f9d5361187e904f937af3cabd1e1071ca.tar.gz
dotfiles-9a5d6d9f9d5361187e904f937af3cabd1e1071ca.zip
Don't bother checking for ls --color
Diffstat (limited to 'sh')
-rw-r--r--sh/profile.d/ls.sh25
1 files changed, 7 insertions, 18 deletions
diff --git a/sh/profile.d/ls.sh b/sh/profile.d/ls.sh
index 3ecaa5fd..7757f3fe 100644
--- a/sh/profile.d/ls.sh
+++ b/sh/profile.d/ls.sh
@@ -1,19 +1,8 @@
-# Store ls(1)'s --help output in a variable
-lshelp=$(ls --help 2>/dev/null)
-
-# Define and store appropriate colors for ls(1) if applicable
-case $lshelp in
- *--color*)
- if command -v dircolors >/dev/null 2>&1 ; then
- if [ -r "$HOME"/.dircolors ] ; then
- eval "$(dircolors --sh -- "$HOME"/.dircolors)"
- else
- eval "$(dircolors --sh)"
- fi
- fi
- ;;
-esac
-
-# We're done parsing ls(1)'s --help output now
-unset -v lshelp
+if command -v dircolors >/dev/null 2>&1 ; then
+ if [ -r "$HOME"/.dircolors ] ; then
+ eval "$(dircolors --sh -- "$HOME"/.dircolors)"
+ else
+ eval "$(dircolors --sh)"
+ fi
+fi