Shell startup performance improvement

not spawning head, cut (2 times) when scanning for ls version
This commit is contained in:
2013-04-11 20:03:04 +03:00
parent 6cc4675caf
commit 398a295d0d
+4 -3
View File
@@ -11,9 +11,10 @@ export DOOMWADDIR=~/dist/games/doom/wad
# redefinitions
if [ "$(uname -s)" = "Linux" ]; then
LS_VER=`/bin/ls --version | head -1 | cut -d' ' -f4`
LS_VER_INT=`echo $LS_VER | cut -d'.' -f1`
if [ $LS_VER_INT -lt 8 ]; then
LS_VER=$(/bin/ls --version)
LS_VER=${LS_VER/.*/}
LS_VER=${LS_VER/* /}
if [ $LS_VER -lt 8 ]; then
alias ls='ls -hF --color=auto'
else
alias ls='ls -hF --color=auto --group-directories-first'