annotate bash @ 49:b924652e169d

[bash] Various tweaks: prompt, unset for check variables, etc
author Edho Prima Arief <me@myconan.net>
date Wed, 27 Apr 2011 22:38:44 +0700
parents 416f9d3e9ee8
children b7a63c71b07f
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
49
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
3 [ -f .ecos_bash.before ] && . .ecos_bash.before
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
4
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
5 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
6
49
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
7 PS1='[\u@\h \W]\$ '
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
8
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
9 export PAGER='less -Rins'
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
10 export EDITOR=vi
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
11
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
12 alias less='less -Rins'
43
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
13 _has_rm_I=
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
14 _has_gnu_ls=
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
15 _has_bsd_ls=
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
16 case "$(uname -s)" in
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
17 Linux)
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
18 _has_rm_I=y
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
19 _has_gnu_ls=y
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 SunOS)
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
22 [ -x /usr/gnu/bin/rm ] && _has_rm_I=y
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
23 [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y
49
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
24 [ -d /usr/gnu/bin ] && export PATH="/usr/gnu/bin:${PATH}"
43
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
25 ;;
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
26 *BSD)
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
27 _has_rm_I=y
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
28 ;;
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
29 esac
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
30 if [ $_has_rm_I = y ]; then
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
31 alias rm="rm -I"
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
32 else
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
33 alias rm="rm -i"
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
34 fi
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
35
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
36 if [ $_has_gnu_ls = y ]; then
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
37 alias ls="ls -F --color=auto"
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
38 else
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
39 alias ls="ls -F"
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
40 fi
b4965a1610f6 [bash] Yaaay bashrc.
Edho Prima Arief <me@myconan.net>
parents: 40
diff changeset
41
49
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
42 unset _has_rm_I
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
43 unset _has_gnu_ls
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
44 unset _has_bsd_ls
b924652e169d [bash] Various tweaks: prompt, unset for check variables, etc
Edho Prima Arief <me@myconan.net>
parents: 48
diff changeset
45
48
416f9d3e9ee8 [bash] Forgot the .bash.conf => .ecos_bash change.
Edho Prima Arief <me@myconan.net>
parents: 44
diff changeset
46 [ -f .ecos_bash.after ] && . .ecos_bash.after