From 69b3d0792343fdc58365b466b2ac25627ae34c7a Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Wed, 11 Apr 2012 21:38:04 -0400 Subject: [PATCH] [Fix #134] Check for GNU du instead of Linux --- modules/utility/functions/duh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/utility/functions/duh b/modules/utility/functions/duh index 69eb2cad..3c98c8e0 100644 --- a/modules/utility/functions/duh +++ b/modules/utility/functions/duh @@ -8,7 +8,7 @@ function duh { (( $# == 0 )) && set -- * - if [[ "$OSTYPE" == linux* ]]; then + if grep -q -i 'GNU' < <(du --version 2>&1); then du -khsc "$@" | sort -h -r else du -kcs "$@" | awk '{ printf "%9.1fM %s\n", $1 / 1024, $2 } ' | sort -n -r