From e45e72ec2705445476ee37725ded19eace970857 Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Tue, 2 Nov 2010 14:50:45 +0100 Subject: [PATCH] usage() for os x and linux --- plugins/base.plugin.bash | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins/base.plugin.bash b/plugins/base.plugin.bash index 2d78028..d19b149 100644 --- a/plugins/base.plugin.bash +++ b/plugins/base.plugin.bash @@ -32,12 +32,21 @@ pri() { # disk usage per directory +# in Mac OS X and Linux usage () { - if [ $1 ] - then - du -hd $1 - else - du -hd 1 - fi + if [ $(uname) = "Darwin" ]; then + if [ -n $1 ]; then + du -hd $1 + else + du -hd 1 + fi + + elif [ $(uname) = "Linux" ]; then + if [ -n $1 ]; then + du -h --max-depth=1 $1 + else + du -h --max-depth=1 + fi + fi } -- 2.17.1