diff options
author | kaotisk <kaotisk@arching-kaos.com> | 2021-12-18 07:56:07 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.com> | 2021-12-18 07:56:07 +0200 |
commit | 73125773584e562b07e2246aa2e11838b0ce7052 (patch) | |
tree | f8da017002d212e36c7d896ee9cff8229401a4b5 /json2bash | |
parent | 00d341f72b8a1ef978810b57fc2305aaf7008872 (diff) | |
download | arching-kaos-tools-73125773584e562b07e2246aa2e11838b0ce7052.tar.gz arching-kaos-tools-73125773584e562b07e2246aa2e11838b0ce7052.tar.bz2 arching-kaos-tools-73125773584e562b07e2246aa2e11838b0ce7052.zip |
Simple pipeline using sed
Inputs a json object with keys and values
Outputs a bash like assigning to variables
Diffstat (limited to 'json2bash')
-rwxr-xr-x | json2bash | 11 |
1 files changed, 11 insertions, 0 deletions
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 <kaotisk/kaotiskhund> +# +# Strips " , { } from input and replaces ":" with = +# +# Usage: +# ipfs cat <hash> | 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' |