From: Maxim Mamontov Date: Sat, 25 Oct 2014 01:53:55 +0000 (+0300) Subject: Portable count. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/2ab46b57b6d575e31dbfa48a77cd7308c01f5914?ds=inline;hp=668e4a697bab5faa6a78e9708cff8bb1d4a36241 Portable count. --- diff --git a/functest/functions b/functest/functions index 183ddc4a..51a1fd32 100644 --- a/functest/functions +++ b/functest/functions @@ -33,8 +33,10 @@ count() { if [ "$1" == "" ] then - printf "0\n" + printf "0" else - printf "$1\n" | wc -l + RES=`printf "$1\n" | wc -l` + RES=`trim "$RES"` + printf "$RES" fi }