blob: 5456bf99c974b128f61213f242dc1ccb662373b5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
# Define function wrapper for ls(1) with --color option if LS_COLORS is set;
# checks that color is available in the terminal within the function
if [[ $LS_COLORS ]] ; then
ls() {
local -i colors=$(tput colors 2>/dev/null)
if ((colors >= 8)) ; then
command ls --color=auto "$@"
else
command ls "$@"
fi
}
fi
|