diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh
index b49cd49fee0eafc7bbcba3a73bbdb21ab4e552d9..f216784fff8ff39a18e46a2ddd0e6a76085aaa29 100644
--- a/lustre/tests/sanity.sh
+++ b/lustre/tests/sanity.sh
@@ -1558,30 +1558,33 @@ test_56() {
         rm -rf $DIR/d56
         mkdir $DIR/d56
         mkdir $DIR/d56/dir
-        for i in `seq 1 3` ; do
+        NUMFILES=3
+        NUMFILESx2=$(($NUMFILES * 2))
+        for i in `seq 1 $NUMFILES` ; do
                 touch $DIR/d56/file$i
                 touch $DIR/d56/dir/file$i
         done
 
         # test lfs find with --recursive
-        FILENUM=`$LFIND --recursive $DIR/d56 | grep obdidx | wc -l`
-        [ $FILENUM -eq 6 ] || error \
-                "lfs find --recursive $DIR/d56 wrong: found $FILENUM, expected 6"
-        FILENUM=`$LFIND $DIR/d56 | grep obdidx | wc -l`
-        [ $FILENUM -eq 3 ] || error \
-                "lfs find $DIR/d56 without --recursive wrong: found $FILENUM, expected 3"
+        FILENUM=`$LFIND --recursive $DIR/d56 | grep -c obdidx`
+        [ $FILENUM -eq $NUMFILESx2 ] || error \
+                "lfs find --recursive $DIR/d56 wrong: found $FILENUM, expected $NUMFILESx2"
+        FILENUM=`$LFIND $DIR/d56 | grep -c obdidx`
+        [ $FILENUM -eq $NUMFILES ] || error \
+                "lfs find $DIR/d56 without --recursive wrong: found $FILENUM,
+		expected $NUMFILES"
         echo "lfs find --recursive passed."
 
         # test lfs find with file instead of dir
-        FILENUM=`$LFIND $DIR/d56/file1 | grep obdidx | wc -l`
+        FILENUM=`$LFIND $DIR/d56/file1 | grep -c obdidx`
         [ $FILENUM  -eq 1 ] || error \
                  "lfs find $DIR/d56/file1 wrong:found $FILENUM, expected 1"
         echo "lfs find file passed."
 
         #test lfs find with --verbose
-        [ `$LFIND --verbose $DIR/d56 | grep lmm_magic | wc -l` -eq 3 ] ||\
-                error "lfs find --verbose $DIR/d56 wrong: should find 3 lmm_magic info"
-        [ `$LFIND $DIR/d56 | grep lmm_magic | wc -l` -eq 0 ] || error \
+        [ `$LFIND --verbose $DIR/d56 | grep -c lmm_magic` -eq $NUMFILES ] ||\
+                error "lfs find --verbose $DIR/d56 wrong: should find $NUMFILES lmm_magic info"
+        [ `$LFIND $DIR/d56 | grep -c lmm_magic` -eq 0 ] || error \
                 "lfs find $DIR/d56 without --verbose wrong: should not show lmm_magic info"
         echo "lfs find --verbose passed."
 
@@ -1591,13 +1594,13 @@ test_56() {
 
         [  "$STRIPECOUNT" -lt 2 ] && \
                 echo "skipping other lfs find --obd test" && return
-        FILENUM=`$LFIND --recursive $DIR/d56 | sed -n '/^[\t ]*1[\t ]/p' | wc -l`
-        OBDUUID=`$LFIND --recursive $DIR/d56 | sed -n '/^[\t ]*1:/p' | awk '{print $2}'`
+        FILENUM=`$LFIND --recursive $DIR/d56 | sed -n '/^[	 ]*1[	 ]/p' | wc -l`
+        OBDUUID=`$LFIND --recursive $DIR/d56 | sed -n '/^[	 ]*1:/p' | awk '{print $2}'`
         FOUND=`$LFIND -r --obd $OBDUUID $DIR/d56 | wc -l`
-        [ $FOUND -eq $FILENUM ] ||\
+        [ $FOUND -eq $FILENUM ] || \
                 error "lfs find --obd wrong: found $FOUND, expected $FILENUM"
-        [ `$LFIND -r -v --obd $OBDUUID $DIR/d56 | sed '/^[\t ]*1[\t ]/d' | \
-                sed -n '/^[\t ]*[0-9][0-9]*[\t ]/p' | wc -l` -eq 0 ] || \
+        [ `$LFIND -r -v --obd $OBDUUID $DIR/d56 | sed '/^[	 ]*1[	 ]/d' | \
+                sed -n '/^[	 ]*[0-9][0-9]*[	 ]/p' | wc -l` -eq 0 ] || \
                 error "lfs find --obd wrong: should not show file on other obd"
         echo "lfs find --obd passed."
 }