Mercurial > ec-dotfiles
comparison bash @ 102:7a287a518718
Merge.
author | Edho Prima Arief <edho@myconan.net> |
---|---|
date | Thu, 18 Aug 2011 15:20:54 +0700 |
parents | 29bd7f6ef58a a1c6b40a535f |
children | 0e8018fb4203 |
comparison
equal
deleted
inserted
replaced
89:29bd7f6ef58a | 102:7a287a518718 |
---|---|
1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
2 | 2 |
3 [ -f .ecos_bash.before ] && . .ecos_bash.before | 3 [ -f "${HOME}/.ecos_bash.before" ] && . "${HOME}/.ecos_bash.before" |
4 | 4 |
5 PATH="${HOME}/.ecos_bin:${HOME}/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" | 5 _org_path="${PATH}" |
6 export PATH="${HOME}/.ecos_bin:${HOME}/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" | |
6 | 7 |
7 PS1='[\u@\h \W]\$ ' | 8 PS1='[\u@\h \W]\$ ' |
8 | 9 |
9 export PAGER="less -Rins" | 10 export PAGER="less -Rins" |
10 export EDITOR=vi | 11 export EDITOR=vi |
11 export LANG="en_US.UTF-8" | 12 export LANG="en_US.UTF-8" |
13 unset LS_COLORS | |
12 | 14 |
13 alias less="less -Rins" | 15 alias less="less -Rins" |
14 #assuming POSIX grep | 16 #assuming POSIX grep |
15 alias fgrep="grep -F" | 17 alias fgrep="grep -F" |
16 alias egrep="grep -E" | 18 alias egrep="grep -E" |
19 alias ls="ls -F" | |
20 alias rm="rm -i" | |
21 alias rd="rdesktop -g 1280x600 -K -a 16 -z -P -r sound:off -r clipboard:CLIPBOARD -5" | |
17 | 22 |
18 _has_rm_I= | 23 _has_rm_I= |
19 _has_gnu_ls= | 24 _has_gnu_ls= |
20 _has_gnu_grep= | 25 _has_gnu_grep= |
21 _has_bsd_ls= | |
22 case "$(uname -s)" in | 26 case "$(uname -s)" in |
23 Linux) | 27 Linux) |
24 _has_rm_I=y | 28 _has_rm_I=y |
25 _has_gnu_ls=y | 29 _has_gnu_ls=y |
30 _has_gnu_grep=y | |
26 ;; | 31 ;; |
27 SunOS) | 32 SunOS) |
28 [ -x /usr/gnu/bin/rm ] && _has_rm_I=y | 33 [ -x /usr/gnu/bin/rm ] && _has_rm_I=y |
29 [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y | 34 [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y |
30 [ -x /usr/gnu/bin/grep ] && _has_gnu_grep=y | 35 [ -x /usr/gnu/bin/grep ] && _has_gnu_grep=y |
31 [ -d /usr/xpg4/bin ] && PATH="/usr/xpg4/bin:${PATH}" | 36 [ -d /usr/xpg4/bin ] && PATH="/usr/xpg4/bin:${PATH}" |
32 [ -d /opt/csw/bin ] && PATH="/opt/csw/bin:${PATH}" | 37 [ -d /opt/csw/bin ] && PATH="/opt/csw/bin:${PATH}" |
33 [ -d /opt/csw/sbin ] && PATH="/opt/csw/sbin:${PATH}" | 38 [ -d /opt/csw/sbin ] && PATH="/opt/csw/sbin:${PATH}" |
34 [ -d /usr/gnu/bin ] && PATH="/usr/gnu/bin:${PATH}" | 39 [ -d /usr/gnu/bin ] && PATH="/usr/gnu/bin:${PATH}" |
40 export PATH | |
35 alias ping="ping -s" | 41 alias ping="ping -s" |
36 alias ping6="ping -A inet6" | 42 alias ping6="ping -A inet6" |
37 ;; | 43 ;; |
38 FreeBSD) | 44 FreeBSD) |
39 _has_rm_I=y | 45 _has_rm_I=y |
40 CLICOLOR= | 46 CLICOLOR= |
41 ;; | 47 ;; |
48 OpenBSD) | |
49 if command -v colorls > /dev/null 2>&1; then | |
50 export CLICOLOR= | |
51 alias ls='colorls -F' | |
52 fi | |
53 ;; | |
54 CYGWIN*) | |
55 export PATH="${PATH}:${_org_path}" | |
56 ;; | |
42 esac | 57 esac |
43 if [ "${_has_rm_I}" = y ]; then | |
44 alias rm="rm -I" | |
45 else | |
46 alias rm="rm -i" | |
47 fi | |
48 | 58 |
49 if [ "${_has_gnu_ls}" = y ]; then | 59 [ "${_has_rm_I}" = y ] && alias rm="rm -I" |
50 alias ls="ls -F --color=auto" | 60 [ "${_has_gnu_ls}" = y ] && alias ls="ls -F --color=auto" |
51 else | 61 [ "${_has_gnu_grep}" = y ] && alias grep="grep --color=auto" |
52 alias ls="ls -F" | |
53 fi | |
54 | |
55 if [ "${_has_gnu_grep}" = y ]; then | |
56 alias grep="grep --color=auto" | |
57 fi | |
58 | 62 |
59 unset _has_rm_I | 63 unset _has_rm_I |
60 unset _has_gnu_ls | 64 unset _has_gnu_ls |
61 unset _has_gnu_grep | 65 unset _has_gnu_grep |
62 unset _has_bsd_ls | |
63 | 66 |
64 export PATH | |
65 | 67 |
66 case "${TERM}" in | 68 case "${TERM}" in |
67 xterm*|screen*|dtterm) | 69 xterm*|screen*|dtterm) |
68 PROMPT_COMMAND='echo -ne "\033]0;${LOGNAME}@${HOSTNAME}: ${PWD}\007"' | 70 PROMPT_COMMAND='echo -ne "\033]0;${LOGNAME}@${HOSTNAME}: ${PWD}\007"' |
69 ;; | 71 ;; |
70 esac | 72 esac |
71 | 73 |
72 command -v vim > /dev/null 2>&1 && alias vi=vim | 74 if command -v vim > /dev/null 2>&1; then |
73 [ -f .ecos_bash.after ] && . .ecos_bash.after | 75 alias vi=vim |
76 export EDITOR=vim | |
77 fi | |
78 [ -f "${HOME}/.ecos_bash.after" ] && . "${HOME}/.ecos_bash.after" |