annotate bash @ 43:b4965a1610f6

[bash] Yaaay bashrc.
author Edho Prima Arief <me@myconan.net>
date Tue, 26 Apr 2011 13:03:31 +0700
parents 34818dfa7f36
children 1f1af28f36e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
43
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
1 #!/usr/bin/env bash
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
2
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
3 [ -f .bash.conf.before ] && . .bash.conf.before
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
4 _has_rm_I=
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
5 _has_gnu_ls=
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
6 _has_bsd_ls=
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
7 case "$(uname -s)" in
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
8 Linux)
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
9 _has_rm_I=y
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
10 _has_gnu_ls=y
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
11 ;;
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
12 SunOS)
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
13 [ -x /usr/gnu/bin/rm ] && _has_rm_I=y
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
14 [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
15 ;;
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
16 *BSD)
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
17 _has_rm_I=y
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
18 ;;
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
19 esac
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
20
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
21 if [ $_has_rm_I = y ]; then
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
22 alias rm="rm -I"
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
23 else
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
24 alias rm="rm -i"
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
25 fi
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
26
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
27 if [ $_has_gnu_ls = y ]; then
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
28 alias ls="ls -F --color=auto"
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
29 else
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
30 alias ls="ls -F"
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
31 fi
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
32
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
33 [ -f .bash.conf.after ] && . .bash.conf.after