comparison rc/bash @ 248:fbb03c862b63

Awesome merge.
author Edho Arief <edho@myconan.net>
date Tue, 08 Nov 2011 11:59:49 +0700
parents 3d57990fe9d1
children 68b765e9cf76
comparison
equal deleted inserted replaced
132:53b39ca5a6ea 248:fbb03c862b63
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2
3 case "${-}" in
4 *i*) ;;
5 *) return;;
6 esac
2 7
3 if [ "${ECOS_BASH_LOADED}" != "yes" ]; then 8 if [ "${ECOS_BASH_LOADED}" != "yes" ]; then
4 ECOS_BASH_LOADED="yes" 9 ECOS_BASH_LOADED="yes"
5 else 10 else
6 return 11 return
33 alias rd="rdesktop -g 1280x600 -K -a 16 -z -P -r sound:off -r clipboard:CLIPBOARD -5" 38 alias rd="rdesktop -g 1280x600 -K -a 16 -z -P -r sound:off -r clipboard:CLIPBOARD -5"
34 39
35 _has_rm_I= 40 _has_rm_I=
36 _has_gnu_ls= 41 _has_gnu_ls=
37 _has_gnu_grep= 42 _has_gnu_grep=
43 _ls="ls"
38 case "$(uname -s)" in 44 case "$(uname -s)" in
39 Linux) 45 Linux)
40 _has_rm_I=y 46 _has_rm_I=y
41 _has_gnu_ls=y 47 _has_gnu_ls=y
42 _has_gnu_grep=y 48 _has_gnu_grep=y
43 ;; 49 ;;
44 SunOS) 50 SunOS)
45 [ -x /usr/gnu/bin/rm ] && _has_rm_I=y 51 [ -x /usr/gnu/bin/rm ] && _has_rm_I=y
46 [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y 52 [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y
47 [ -x /usr/gnu/bin/grep ] && _has_gnu_grep=y 53 [ -x /usr/gnu/bin/grep ] && _has_gnu_grep=y
48 [ -d /usr/xpg4/bin ] && PATH="/usr/xpg4/bin:${PATH}"
49 [ -d /opt/csw/bin ] && PATH="/opt/csw/bin:${PATH}" 54 [ -d /opt/csw/bin ] && PATH="/opt/csw/bin:${PATH}"
50 [ -d /opt/csw/sbin ] && PATH="/opt/csw/sbin:${PATH}" 55 [ -d /opt/csw/sbin ] && PATH="/opt/csw/sbin:${PATH}"
51 [ -d /usr/gnu/bin ] && PATH="/usr/gnu/bin:${PATH}" 56 [ -d /usr/gnu/bin ] && PATH="/usr/gnu/bin:${PATH}"
57 [ -d /usr/sfw/bin ] && PATH="${PATH}:/usr/sfw/bin"
58 [ -d /usr/xpg4/bin ] && PATH="${PATH}:/usr/xpg4/bin"
52 export PATH 59 export PATH
53 alias ping="ping -s" 60 alias ping="ping -s"
54 alias ping6="ping -A inet6" 61 alias ping6="ping -A inet6"
55 ;; 62 ;;
56 FreeBSD) 63 FreeBSD)
57 _has_rm_I=y 64 _has_rm_I=y
58 export CLICOLOR= 65 export CLICOLOR=
59 export LSCOLORS=ExGxFxdxCxegedabagExEx 66 export LSCOLORS=ExGxFxdxCxegedabagExEx
60 ;; 67 ;;
61 OpenBSD) 68 OpenBSD)
62 if command -v colorls > /dev/null 2>&1; then 69 if command -v gls > /dev/null 2>&1; then
70 _has_gnu_ls=y
71 _ls="gls"
72 elif command -v colorls > /dev/null 2>&1; then
63 export CLICOLOR= 73 export CLICOLOR=
74 export LSCOLORS=ExGxFxdxCxegedabagExEx
64 alias ls='colorls -F' 75 alias ls='colorls -F'
65 fi 76 fi
66 ;; 77 ;;
67 CYGWIN*) 78 CYGWIN*)
68 export PATH="${PATH}:${_org_path}" 79 export PATH="${PATH}:${_org_path}"
69 ;; 80 ;;
70 esac 81 esac
71 82
72 [ "${_has_rm_I}" = y ] && alias rm="rm -I" 83 [ "${_has_rm_I}" = y ] && alias rm="rm -I"
73 [ "${_has_gnu_ls}" = y ] && alias ls="ls -F --color=auto" 84 [ "${_has_gnu_ls}" = y ] && alias ls="${_ls} -F --color=auto"
74 [ "${_has_gnu_grep}" = y ] && alias grep="grep --color=auto" 85 [ "${_has_gnu_grep}" = y ] && alias grep="grep --color=auto"
75 86
76 unset _has_rm_I 87 unset _has_rm_I
77 unset _has_gnu_ls 88 unset _has_gnu_ls
78 unset _has_gnu_grep 89 unset _has_gnu_grep
90 unset _ls
79 91
80 92
81 case "${TERM}" in 93 case "${TERM}" in
82 xterm*|screen*|dtterm) 94 xterm*|screen*|dtterm)
83 PROMPT_COMMAND='echo -ne "\033]0;${LOGNAME}@${HOSTNAME}: ${PWD}\007"' 95 PROMPT_COMMAND='echo -ne "\033]0;${LOGNAME}@${HOSTNAME}: ${PWD}\007";'"${PROMPT_COMMAND}"
84 ;; 96 ;;
85 esac 97 esac
86 98
87 if command -v vim > /dev/null 2>&1; then 99 if command -v vim > /dev/null 2>&1; then
88 alias vi=vim 100 alias vi=vim