comparison rc/bash @ 238:5dcbf6ab0109

Prioritize gnuls over colorls on OpenBSD. Modified GNU ls alias to allow different executable name.
author Edho Arief <edho@myconan.net>
date Sun, 02 Oct 2011 07:22:57 +0700
parents 735b21c05f54
children ebfa844d2ef8
comparison
equal deleted inserted replaced
237:0d008b554aac 238:5dcbf6ab0109
33 alias rd="rdesktop -g 1280x600 -K -a 16 -z -P -r sound:off -r clipboard:CLIPBOARD -5" 33 alias rd="rdesktop -g 1280x600 -K -a 16 -z -P -r sound:off -r clipboard:CLIPBOARD -5"
34 34
35 _has_rm_I= 35 _has_rm_I=
36 _has_gnu_ls= 36 _has_gnu_ls=
37 _has_gnu_grep= 37 _has_gnu_grep=
38 _ls="ls"
38 case "$(uname -s)" in 39 case "$(uname -s)" in
39 Linux) 40 Linux)
40 _has_rm_I=y 41 _has_rm_I=y
41 _has_gnu_ls=y 42 _has_gnu_ls=y
42 _has_gnu_grep=y 43 _has_gnu_grep=y
57 _has_rm_I=y 58 _has_rm_I=y
58 export CLICOLOR= 59 export CLICOLOR=
59 export LSCOLORS=ExGxFxdxCxegedabagExEx 60 export LSCOLORS=ExGxFxdxCxegedabagExEx
60 ;; 61 ;;
61 OpenBSD) 62 OpenBSD)
62 if command -v colorls > /dev/null 2>&1; then 63 if command -v gls > /dev/null 2>&1; then
64 _has_gnu_ls=y
65 _ls="gls"
66 elif command -v colorls > /dev/null 2>&1; then
63 export CLICOLOR= 67 export CLICOLOR=
64 export LSCOLORS=ExGxFxdxCxegedabagExEx 68 export LSCOLORS=ExGxFxdxCxegedabagExEx
65 alias ls='colorls -F' 69 alias ls='colorls -F'
66 fi 70 fi
67 ;; 71 ;;
69 export PATH="${PATH}:${_org_path}" 73 export PATH="${PATH}:${_org_path}"
70 ;; 74 ;;
71 esac 75 esac
72 76
73 [ "${_has_rm_I}" = y ] && alias rm="rm -I" 77 [ "${_has_rm_I}" = y ] && alias rm="rm -I"
74 [ "${_has_gnu_ls}" = y ] && alias ls="ls -F --color=auto" 78 [ "${_has_gnu_ls}" = y ] && alias ls="${_ls} -F --color=auto"
75 [ "${_has_gnu_grep}" = y ] && alias grep="grep --color=auto" 79 [ "${_has_gnu_grep}" = y ] && alias grep="grep --color=auto"
76 80
77 unset _has_rm_I 81 unset _has_rm_I
78 unset _has_gnu_ls 82 unset _has_gnu_ls
79 unset _has_gnu_grep 83 unset _has_gnu_grep
84 unset _ls
80 85
81 86
82 case "${TERM}" in 87 case "${TERM}" in
83 xterm*|screen*|dtterm) 88 xterm*|screen*|dtterm)
84 PROMPT_COMMAND='echo -ne "\033]0;${LOGNAME}@${HOSTNAME}: ${PWD}\007";'"${PROMPT_COMMAND}" 89 PROMPT_COMMAND='echo -ne "\033]0;${LOGNAME}@${HOSTNAME}: ${PWD}\007";'"${PROMPT_COMMAND}"