summaryrefslogtreecommitdiffstats
path: root/kvutils
diff options
context:
space:
mode:
authortv <tv@also>2010-04-13 21:00:33 +0200
committertv <tv@also>2011-07-24 20:13:43 +0200
commitd23a1254932461d98d3fffa3a567c2a64b6f6757 (patch)
tree8e8d9c0b98a3fdd68a9d1036980be807676a7c31 /kvutils
parented912b47481750b273570735cba991cbef9dc7d6 (diff)
Initial commit: anonbox, kvutils
Diffstat (limited to 'kvutils')
-rwxr-xr-xkvutils/kv2csv5
-rwxr-xr-xkvutils/kv2sh3
2 files changed, 8 insertions, 0 deletions
diff --git a/kvutils/kv2csv b/kvutils/kv2csv
new file mode 100755
index 00000000..f075229c
--- /dev/null
+++ b/kvutils/kv2csv
@@ -0,0 +1,5 @@
+#! /bin/sh
+set -euf
+kv="`cat`"
+echo "$kv" | cut -f 1 | tr '\n' , | sed 's/,$//' ; echo
+echo "$kv" | cut -f 2 | tr '\n' , | sed 's/,$//' ; echo
diff --git a/kvutils/kv2sh b/kvutils/kv2sh
new file mode 100755
index 00000000..be6fc85a
--- /dev/null
+++ b/kvutils/kv2sh
@@ -0,0 +1,3 @@
+#! /bin/sh
+# TODO escape and ensure correct sh syntax
+sed -r 's/\t/="/;s/$/"/'