From 398a295d0d46d16fa1f859be7858fa7d0b500445 Mon Sep 17 00:00:00 2001 From: Artem Sheremet Date: Thu, 11 Apr 2013 20:03:04 +0300 Subject: [PATCH] Shell startup performance improvement not spawning head, cut (2 times) when scanning for ls version --- .rc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.rc b/.rc index 4fedf5e..943f024 100644 --- a/.rc +++ b/.rc @@ -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'