Permalink
Browse files

Just added a test for all args, usage instructions and clarification …

…we're looking for MB if any are empty.
  • Loading branch information...
1 parent 7f6e144 commit efe9270a0141f5a7394b4f780b37f5c2d972b760 C. Flores committed Jul 8, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 dir_size.sh
View
@@ -4,6 +4,12 @@ MINS=$1
MAXS=$2
DIR=$3
+if [ -z "$MINS" ] || [ -z "$MAXS" ] || [ -z "$DIR" ]; then
+ echo "usage: $0 <minimum size in MB> <maximum size in MB> <directory>
+ example: $0 100 100000 /home"
+ exit 2
+fi
+
if [ ! -d $DIR ]; then
echo "status err $DIR does not exist"
exit

0 comments on commit efe9270

Please sign in to comment.