]> git.stg.codes - stg.git/blobdiff - functest/functions
Portable count.
[stg.git] / functest / functions
index 183ddc4affea66cbfdb61508bfa05ec6868ec51b..51a1fd32477b20231326eed90d42a6402ac49e88 100644 (file)
@@ -33,8 +33,10 @@ count()
 {
     if [ "$1" == "" ]
     then
 {
     if [ "$1" == "" ]
     then
-        printf "0\n"
+        printf "0"
     else
     else
-        printf "$1\n" | wc -l
+        RES=`printf "$1\n" | wc -l`
+        RES=`trim "$RES"`
+        printf "$RES"
     fi
 }
     fi
 }