if uname -s Darwin then alias ls ls -FG elif ls --version grep Stallma

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
if [ `uname -s` = Darwin ]; then
alias ls="ls -FG"
elif ls --version | grep Stallman >/dev/null; then
alias ls="ls --color=auto -phs"
else
alias ls="ls -phs"
fi
if grep --version | grep GNU >/dev/null; then
export GREP_OPTIONS='--color=auto --directories=recurse'
fi