From 97a244ee495d1048caf5b9c7e226e07875ad85aa Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Wed, 11 Apr 2012 19:26:47 +0100 Subject: [PATCH] Look for gnu-coreutils commands instead of $OSTYPE It's possible to have the gnu-coreutils on other environments than Linux --- modules/utility/functions/duh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/utility/functions/duh b/modules/utility/functions/duh index 69eb2cad..4a7147a5 100644 --- a/modules/utility/functions/duh +++ b/modules/utility/functions/duh @@ -8,7 +8,7 @@ function duh { (( $# == 0 )) && set -- * - if [[ "$OSTYPE" == linux* ]]; then + if (( $+commands[dircolors] )); then du -khsc "$@" | sort -h -r else du -kcs "$@" | awk '{ printf "%9.1fM %s\n", $1 / 1024, $2 } ' | sort -n -r @@ -17,4 +17,3 @@ function duh { compdef _du duh duh "$@" -