summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-12-03 15:45:02 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-12-03 15:45:02 +0300
commit4fcb7a47787e26b54ef8b786c7b07cee3fd49819 (patch)
tree901b370ee6bc2fba9da9dae444523e1f2876e3b3
parent257fc365155c34484d6d9cc52014c7e98c27d003 (diff)
downloadvsvs-4fcb7a47787e26b54ef8b786c7b07cee3fd49819.tar
vsvs-4fcb7a47787e26b54ef8b786c7b07cee3fd49819.tar.xz
vsvs-4fcb7a47787e26b54ef8b786c7b07cee3fd49819.zip
.
-rw-r--r--vsvs-map10
-rw-r--r--vsvs-sum10
2 files changed, 12 insertions, 8 deletions
diff --git a/vsvs-map b/vsvs-map
index fec86f1..dbe1ecb 100644
--- a/vsvs-map
+++ b/vsvs-map
@@ -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}"
diff --git a/vsvs-sum b/vsvs-sum
index faeaa16..1684dd8 100644
--- a/vsvs-sum
+++ b/vsvs-sum
@@ -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}"