view 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
line wrap: on
line source

#!/usr/bin/env bash

[ -f .bash.conf.before ] && . .bash.conf.before
_has_rm_I=
_has_gnu_ls=
_has_bsd_ls=
case "$(uname -s)" in
  Linux)
    _has_rm_I=y
    _has_gnu_ls=y
  ;;
  SunOS)
    [ -x /usr/gnu/bin/rm ] && _has_rm_I=y
    [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y
  ;;
  *BSD)
    _has_rm_I=y
  ;;
esac

if [ $_has_rm_I = y ]; then
  alias rm="rm -I"
else
  alias rm="rm -i"
fi

if [ $_has_gnu_ls = y ]; then
  alias ls="ls -F --color=auto"
else
  alias ls="ls -F"
fi

[ -f .bash.conf.after ] && . .bash.conf.after