# HG changeset patch # User Edho Arief # Date 1317514977 -25200 # Node ID 5dcbf6ab01096a9f0060e0df73224c1903c46c45 # Parent 0d008b554aacbd86143ffeb5d7d7bab76d51b81e Prioritize gnuls over colorls on OpenBSD. Modified GNU ls alias to allow different executable name. diff -r 0d008b554aac -r 5dcbf6ab0109 rc/bash --- a/rc/bash Sun Oct 02 04:33:47 2011 +0700 +++ b/rc/bash Sun Oct 02 07:22:57 2011 +0700 @@ -35,6 +35,7 @@ _has_rm_I= _has_gnu_ls= _has_gnu_grep= +_ls="ls" case "$(uname -s)" in Linux) _has_rm_I=y @@ -59,7 +60,10 @@ export LSCOLORS=ExGxFxdxCxegedabagExEx ;; OpenBSD) - if command -v colorls > /dev/null 2>&1; then + if command -v gls > /dev/null 2>&1; then + _has_gnu_ls=y + _ls="gls" + elif command -v colorls > /dev/null 2>&1; then export CLICOLOR= export LSCOLORS=ExGxFxdxCxegedabagExEx alias ls='colorls -F' @@ -71,12 +75,13 @@ esac [ "${_has_rm_I}" = y ] && alias rm="rm -I" -[ "${_has_gnu_ls}" = y ] && alias ls="ls -F --color=auto" +[ "${_has_gnu_ls}" = y ] && alias ls="${_ls} -F --color=auto" [ "${_has_gnu_grep}" = y ] && alias grep="grep --color=auto" unset _has_rm_I unset _has_gnu_ls unset _has_gnu_grep +unset _ls case "${TERM}" in