Mercurial > ec-dotfiles
annotate 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 |
rev | line source |
---|---|
43 | 1 #!/usr/bin/env bash |
2 | |
71 | 3 [ -f "${HOME}/.ecos_bash.before" ] && . "${HOME}/.ecos_bash.before" |
49
b924652e169d
[bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents:
48
diff
changeset
|
4 |
67 | 5 _org_path="${PATH}" |
62 | 6 export PATH="${HOME}/.ecos_bin:${HOME}/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" |
44
1f1af28f36e9
[bash] Bashrc, c-style ifdef.
Edho Prima Arief <me@myconan.net>
parents:
43
diff
changeset
|
7 |
55
c6d78ab9af22
[bash] turns out one of those that requires '.
Edho Prima Arief <me@myconan.net>
parents:
54
diff
changeset
|
8 PS1='[\u@\h \W]\$ ' |
49
b924652e169d
[bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents:
48
diff
changeset
|
9 |
53
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
Edho Prima Arief <me@myconan.net>
parents:
52
diff
changeset
|
10 export PAGER="less -Rins" |
49
b924652e169d
[bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents:
48
diff
changeset
|
11 export EDITOR=vi |
89
29bd7f6ef58a
Explicit LANG declaration.
Edho Prima Arief <me@myconan.net>
parents:
60
diff
changeset
|
12 export LANG="en_US.UTF-8" |
101
a1c6b40a535f
Ensure no Ubuntuism's ls color bastardization.
Edho Prima Arief <edho@myconan.net>
parents:
96
diff
changeset
|
13 unset LS_COLORS |
49
b924652e169d
[bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents:
48
diff
changeset
|
14 |
53
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
Edho Prima Arief <me@myconan.net>
parents:
52
diff
changeset
|
15 alias less="less -Rins" |
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
Edho Prima Arief <me@myconan.net>
parents:
52
diff
changeset
|
16 #assuming POSIX grep |
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
Edho Prima Arief <me@myconan.net>
parents:
52
diff
changeset
|
17 alias fgrep="grep -F" |
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
Edho Prima Arief <me@myconan.net>
parents:
52
diff
changeset
|
18 alias egrep="grep -E" |
62 | 19 alias ls="ls -F" |
20 alias rm="rm -i" | |
75
f993714efa7b
cool alias, bro (rdesktop)
Edho Prima Arief <me@myconan.net>
parents:
71
diff
changeset
|
21 alias rd="rdesktop -g 1280x600 -K -a 16 -z -P -r sound:off -r clipboard:CLIPBOARD -5" |
53
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
Edho Prima Arief <me@myconan.net>
parents:
52
diff
changeset
|
22 |
43 | 23 _has_rm_I= |
24 _has_gnu_ls= | |
53
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
Edho Prima Arief <me@myconan.net>
parents:
52
diff
changeset
|
25 _has_gnu_grep= |
43 | 26 case "$(uname -s)" in |
27 Linux) | |
28 _has_rm_I=y | |
29 _has_gnu_ls=y | |
96
26c9dc482051
Merge. Linux obviously has gnu grep.
Edho Prima Arief <edho@myconan.net>
parents:
75
diff
changeset
|
30 _has_gnu_grep=y |
43 | 31 ;; |
32 SunOS) | |
33 [ -x /usr/gnu/bin/rm ] && _has_rm_I=y | |
34 [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y | |
53
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
Edho Prima Arief <me@myconan.net>
parents:
52
diff
changeset
|
35 [ -x /usr/gnu/bin/grep ] && _has_gnu_grep=y |
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
Edho Prima Arief <me@myconan.net>
parents:
52
diff
changeset
|
36 [ -d /usr/xpg4/bin ] && PATH="/usr/xpg4/bin:${PATH}" |
50
b7a63c71b07f
[bash] export PATH last, added various default solaris PATH.
Edho Prima Arief <me@myconan.net>
parents:
49
diff
changeset
|
37 [ -d /opt/csw/bin ] && PATH="/opt/csw/bin:${PATH}" |
b7a63c71b07f
[bash] export PATH last, added various default solaris PATH.
Edho Prima Arief <me@myconan.net>
parents:
49
diff
changeset
|
38 [ -d /opt/csw/sbin ] && PATH="/opt/csw/sbin:${PATH}" |
51 | 39 [ -d /usr/gnu/bin ] && PATH="/usr/gnu/bin:${PATH}" |
62 | 40 export PATH |
57
ada5b9534765
[bash] Sanitize sunos ping.
Edho Prima Arief <me@myconan.net>
parents:
56
diff
changeset
|
41 alias ping="ping -s" |
ada5b9534765
[bash] Sanitize sunos ping.
Edho Prima Arief <me@myconan.net>
parents:
56
diff
changeset
|
42 alias ping6="ping -A inet6" |
43 | 43 ;; |
53
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
Edho Prima Arief <me@myconan.net>
parents:
52
diff
changeset
|
44 FreeBSD) |
43 | 45 _has_rm_I=y |
53
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
Edho Prima Arief <me@myconan.net>
parents:
52
diff
changeset
|
46 CLICOLOR= |
43 | 47 ;; |
62 | 48 OpenBSD) |
49 if command -v colorls > /dev/null 2>&1; then | |
50 export CLICOLOR= | |
51 alias ls='colorls -F' | |
52 fi | |
53 ;; | |
67 | 54 CYGWIN*) |
55 export PATH="${PATH}:${_org_path}" | |
56 ;; | |
43 | 57 esac |
58 | |
62 | 59 [ "${_has_rm_I}" = y ] && alias rm="rm -I" |
60 [ "${_has_gnu_ls}" = y ] && alias ls="ls -F --color=auto" | |
61 [ "${_has_gnu_grep}" = y ] && alias grep="grep --color=auto" | |
53
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
Edho Prima Arief <me@myconan.net>
parents:
52
diff
changeset
|
62 |
49
b924652e169d
[bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents:
48
diff
changeset
|
63 unset _has_rm_I |
b924652e169d
[bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents:
48
diff
changeset
|
64 unset _has_gnu_ls |
58 | 65 unset _has_gnu_grep |
49
b924652e169d
[bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents:
48
diff
changeset
|
66 |
56
9343fa4dfd91
[bash] we have vim. Probably.
Edho Prima Arief <me@myconan.net>
parents:
55
diff
changeset
|
67 |
59 | 68 case "${TERM}" in |
69 xterm*|screen*|dtterm) | |
60
be4d0b045487
[bash] LOGNAME instead of USER since the former is more widely available (ie. USER is not set after `sudo su -` on solaris).
Edho Prima Arief <me@myconan.net>
parents:
59
diff
changeset
|
70 PROMPT_COMMAND='echo -ne "\033]0;${LOGNAME}@${HOSTNAME}: ${PWD}\007"' |
59 | 71 ;; |
72 esac | |
73 | |
63
b7814634220a
[bash] branch merge, added EDITOR change to vim when detected.
Edho Prima Arief <me@myconan.net>
parents:
62
diff
changeset
|
74 if command -v vim > /dev/null 2>&1; then |
b7814634220a
[bash] branch merge, added EDITOR change to vim when detected.
Edho Prima Arief <me@myconan.net>
parents:
62
diff
changeset
|
75 alias vi=vim |
b7814634220a
[bash] branch merge, added EDITOR change to vim when detected.
Edho Prima Arief <me@myconan.net>
parents:
62
diff
changeset
|
76 export EDITOR=vim |
b7814634220a
[bash] branch merge, added EDITOR change to vim when detected.
Edho Prima Arief <me@myconan.net>
parents:
62
diff
changeset
|
77 fi |
71 | 78 [ -f "${HOME}/.ecos_bash.after" ] && . "${HOME}/.ecos_bash.after" |