Mercurial > ec-dotfiles
comparison 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 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 48:416f9d3e9ee8 | 49:b924652e169d | 
|---|---|
| 1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash | 
| 2 | 2 | 
| 3 [ -n "${echo_bash}" ] && return | 3 [ -f .ecos_bash.before ] && . .ecos_bash.before | 
| 4 ecos_bash=y | |
| 5 | 4 | 
| 6 [ -f .ecos_bash.before ] && . .ecos_bash.before | 5 export PATH="${HOME}/.ecos_bin:${HOME}/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" | 
| 6 | |
| 7 PS1='[\u@\h \W]\$ ' | |
| 8 | |
| 9 export PAGER='less -Rins' | |
| 10 export EDITOR=vi | |
| 11 | |
| 12 alias less='less -Rins' | |
| 7 _has_rm_I= | 13 _has_rm_I= | 
| 8 _has_gnu_ls= | 14 _has_gnu_ls= | 
| 9 _has_bsd_ls= | 15 _has_bsd_ls= | 
| 10 case "$(uname -s)" in | 16 case "$(uname -s)" in | 
| 11 Linux) | 17 Linux) | 
| 13 _has_gnu_ls=y | 19 _has_gnu_ls=y | 
| 14 ;; | 20 ;; | 
| 15 SunOS) | 21 SunOS) | 
| 16 [ -x /usr/gnu/bin/rm ] && _has_rm_I=y | 22 [ -x /usr/gnu/bin/rm ] && _has_rm_I=y | 
| 17 [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y | 23 [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y | 
| 24 [ -d /usr/gnu/bin ] && export PATH="/usr/gnu/bin:${PATH}" | |
| 18 ;; | 25 ;; | 
| 19 *BSD) | 26 *BSD) | 
| 20 _has_rm_I=y | 27 _has_rm_I=y | 
| 21 ;; | 28 ;; | 
| 22 esac | 29 esac | 
| 23 | |
| 24 if [ $_has_rm_I = y ]; then | 30 if [ $_has_rm_I = y ]; then | 
| 25 alias rm="rm -I" | 31 alias rm="rm -I" | 
| 26 else | 32 else | 
| 27 alias rm="rm -i" | 33 alias rm="rm -i" | 
| 28 fi | 34 fi | 
| 31 alias ls="ls -F --color=auto" | 37 alias ls="ls -F --color=auto" | 
| 32 else | 38 else | 
| 33 alias ls="ls -F" | 39 alias ls="ls -F" | 
| 34 fi | 40 fi | 
| 35 | 41 | 
| 42 unset _has_rm_I | |
| 43 unset _has_gnu_ls | |
| 44 unset _has_bsd_ls | |
| 45 | |
| 36 [ -f .ecos_bash.after ] && . .ecos_bash.after | 46 [ -f .ecos_bash.after ] && . .ecos_bash.after | 
