From bcd60c0f6d582b708ca77d01c8c7074d61d3b97e Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 13 Apr 2010 21:00:33 +0200 Subject: Initial commit: anonbox, kvutils --- kvutils/kv2csv | 5 +++++ kvutils/kv2sh | 3 +++ 2 files changed, 8 insertions(+) create mode 100755 kvutils/kv2csv create mode 100755 kvutils/kv2sh (limited to 'kvutils') 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/$/"/' -- cgit v1.2.3