diff options
-rw-r--r-- | vsvs-map | 10 | ||||
-rw-r--r-- | vsvs-sum | 10 |
2 files changed, 12 insertions, 8 deletions
@@ -14,14 +14,16 @@ do if [ -z "${key}" ] then buf="${buf}"$'\n'"${val}" - elif [ -n "${buf}" ] - then - res="${res}$(echo -n "${buf}" | $1)" + else + if [ -n "${buf}" ] + then + res="${res}$(echo -n "${buf}" | $1)" + fi buf="${val}" fi done if [ -n "${buf}" ] +then res="${res}$(echo -n "${buf}" | $1)" - buf="${val}" fi echo -n "${res}" @@ -14,14 +14,16 @@ do if [ -z "${key}" ] then buf="${buf}"$'\n'"${val}" - elif [ -n "${buf}" ] - then - res="$(echo -n "${buf}" | $1 "${res}")" + else + if [ -n "${buf}" ] + then + res="$(echo -n "${buf}" | $1 "${res}")" + fi buf="${val}" fi done if [ -n "${buf}" ] +then res="$(echo -n "${buf}" | $1 "${res}")" - buf="${val}" fi echo -n "${res}" |