Code Review
/
common
/
bash_it.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
a1b611f
)
usage() for os x and linux
author
Florian Baumann
<flo@noqqe.de>
Tue, 2 Nov 2010 13:50:45 +0000
(14:50 +0100)
committer
Florian Baumann
<flo@noqqe.de>
Tue, 2 Nov 2010 13:50:45 +0000
(14:50 +0100)
plugins/base.plugin.bash
patch
|
blob
|
history
diff --git
a/plugins/base.plugin.bash
b/plugins/base.plugin.bash
index
2d78028
..
d19b149
100644
(file)
--- 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
}