From 1dec7d88d479c8951fc24cce1091a048b1894aa0 Mon Sep 17 00:00:00 2001 From: Jan Moesen Date: Mon, 23 Jul 2012 16:43:46 +0200 Subject: .aliases: Optimize the `ls` flavor detection even further Ref. #89. --- .aliases | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.aliases b/.aliases index dbcafeb..52a588d 100644 --- a/.aliases +++ b/.aliases @@ -19,10 +19,10 @@ alias o="open" alias oo="open ." # Detect which `ls` flavor is in use -if ls --color 2> /dev/null | grep -q 'invalid option'; then # OS X `ls` - colorflag="-G" -else # GNU `ls` +if ls --color > /dev/null 2>&1; then # GNU `ls` colorflag="--color" +else # OS X `ls` + colorflag="-G" fi # List all files colorized in long format -- cgit v1.2.3