2009-01-03 14:15:00 -06:00
|
|
|
#! /bin/sh
|
2009-01-02 18:37:27 -05:00
|
|
|
# colors
|
|
|
|
for dircolors in gdircolors dircolors ; do
|
2009-01-03 14:15:00 -06:00
|
|
|
if (command -v $dircolors > /dev/null 2>&1) ; then
|
|
|
|
[ -f "${HOME}/.dir_colors" ] && eval `$dircolors -b "${HOME}/.dir_colors"` && break
|
2009-01-07 00:54:32 -05:00
|
|
|
[ -f /etc/DIR_COLORS ] && eval `$dircolors -b /etc/DIR_COLORS` && break
|
2009-01-03 14:15:00 -06:00
|
|
|
eval `$dircolors -b` && break
|
2009-01-02 18:37:27 -05:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# gimmie an editor, make it a nice vi clone
|
|
|
|
for EDITOR in vim elvis vile nvi vi ; do
|
2009-01-03 14:15:00 -06:00
|
|
|
(command -v $EDITOR > /dev/null 2>&1) && break
|
2009-01-02 18:37:27 -05:00
|
|
|
done
|
|
|
|
export EDITOR
|
|
|
|
|
2009-01-13 01:36:27 -06:00
|
|
|
# make the history editor the editor we want
|
|
|
|
FCEDIT=$EDITOR
|
|
|
|
export $FCEDIT
|
|
|
|
|
2009-01-02 18:37:27 -05:00
|
|
|
# aliases
|
|
|
|
alias cd..='cd ..'
|
|
|
|
|
|
|
|
# handles per OS aliases, fixes a few terms
|
|
|
|
case `uname -s` in
|
|
|
|
Linux|CYGWIN*)
|
|
|
|
alias ls="ls -h --color=auto"
|
|
|
|
alias grep='grep -d skip --color=auto'
|
|
|
|
;;
|
|
|
|
FreeBSD|Darwin|DragonFly)
|
2009-01-03 14:15:00 -06:00
|
|
|
LSCOLORS=ExGxFxDxCxDxDxHbaDacec
|
|
|
|
export LSCOLORS
|
2009-01-02 18:37:27 -05:00
|
|
|
alias ls="ls -Gh"
|
|
|
|
alias grep='grep -d skip --color=auto'
|
|
|
|
;;
|
|
|
|
Interix)
|
|
|
|
alias ls="ls --color"
|
|
|
|
;;
|
|
|
|
SunOS)
|
2009-01-03 14:15:00 -06:00
|
|
|
if (command -v gls > /dev/null 2>&1) ; then
|
2009-01-02 18:37:27 -05:00
|
|
|
alias ls="gls -h --color=auto"
|
|
|
|
else
|
2009-01-13 17:19:54 -05:00
|
|
|
# you have a GNU ls, surprise...
|
2009-01-12 01:22:16 -05:00
|
|
|
case `ls --version 2>/dev/null | head -n 1` in
|
2009-01-13 17:19:54 -05:00
|
|
|
*fileutils*|*coreutils*)
|
|
|
|
alias ls="ls -h --color=auto"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
alias ls="ls -h"
|
|
|
|
;;
|
|
|
|
esac
|
2009-01-02 18:37:27 -05:00
|
|
|
fi
|
|
|
|
|
2009-01-03 14:15:00 -06:00
|
|
|
if (command -v ggrep > /dev/null 2>&1) ; then
|
2009-01-02 18:37:27 -05:00
|
|
|
alias grep='ggrep -d skip --color=auto'
|
2009-01-13 17:19:54 -05:00
|
|
|
else
|
|
|
|
# woah, you have a GNU grep...
|
2009-01-12 01:22:16 -05:00
|
|
|
case `grep --version 2>/dev/null | head -n 1` in
|
2009-01-13 17:19:54 -05:00
|
|
|
*GNU*)
|
|
|
|
alias grep='grep -d skip --color=auto'
|
|
|
|
;;
|
|
|
|
esac
|
2009-01-02 18:37:27 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
for locate in glocate slocate ; do
|
2009-01-03 14:15:00 -06:00
|
|
|
(command -v $locate > /dev/null 2>&1) && alias locate=$locate
|
2009-01-02 18:37:27 -05:00
|
|
|
done
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
alias df='df -h'
|
|
|
|
alias du='du -h'
|
|
|
|
|
|
|
|
alias ping='ping -c4'
|
|
|
|
|
2009-01-03 14:15:00 -06:00
|
|
|
(command -v time > /dev/null 2>&1) && alias time='command time'
|