From 73125773584e562b07e2246aa2e11838b0ce7052 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sat, 18 Dec 2021 07:56:07 +0200 Subject: Simple pipeline using sed Inputs a json object with keys and values Outputs a bash like assigning to variables --- json2bash | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 json2bash diff --git a/json2bash b/json2bash new file mode 100755 index 0000000..347ca93 --- /dev/null +++ b/json2bash @@ -0,0 +1,11 @@ +#!/bin/bash +# +# json2bash +# +# Kaotisk Hund +# +# Strips " , { } from input and replaces ":" with = +# +# Usage: +# ipfs cat | json2bash +sed -e 's/{//g' | sed -e 's/}//g' | sed -e 's/":"/=/g' | sed -e 's/"//g' | sed -e 's/,//g' | sed -e 's/ //g' -- cgit v1.2.3