Mercurial > ec-dotfiles
annotate bash @ 44:1f1af28f36e9
[bash] Bashrc, c-style ifdef.
author | Edho Prima Arief <me@myconan.net> |
---|---|
date | Wed, 27 Apr 2011 21:15:16 +0700 |
parents | b4965a1610f6 |
children | 416f9d3e9ee8 |
rev | line source |
---|---|
43 | 1 #!/usr/bin/env bash |
2 | |
44
1f1af28f36e9
[bash] Bashrc, c-style ifdef.
Edho Prima Arief <me@myconan.net>
parents:
43
diff
changeset
|
3 [ -n "${echo_bash}" ] && return |
1f1af28f36e9
[bash] Bashrc, c-style ifdef.
Edho Prima Arief <me@myconan.net>
parents:
43
diff
changeset
|
4 ecos_bash=y |
1f1af28f36e9
[bash] Bashrc, c-style ifdef.
Edho Prima Arief <me@myconan.net>
parents:
43
diff
changeset
|
5 |
43 | 6 [ -f .bash.conf.before ] && . .bash.conf.before |
7 _has_rm_I= | |
8 _has_gnu_ls= | |
9 _has_bsd_ls= | |
10 case "$(uname -s)" in | |
11 Linux) | |
12 _has_rm_I=y | |
13 _has_gnu_ls=y | |
14 ;; | |
15 SunOS) | |
16 [ -x /usr/gnu/bin/rm ] && _has_rm_I=y | |
17 [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y | |
18 ;; | |
19 *BSD) | |
20 _has_rm_I=y | |
21 ;; | |
22 esac | |
23 | |
24 if [ $_has_rm_I = y ]; then | |
25 alias rm="rm -I" | |
26 else | |
27 alias rm="rm -i" | |
28 fi | |
29 | |
30 if [ $_has_gnu_ls = y ]; then | |
31 alias ls="ls -F --color=auto" | |
32 else | |
33 alias ls="ls -F" | |
34 fi | |
35 | |
36 [ -f .bash.conf.after ] && . .bash.conf.after |