Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 657

Using jq to create JSON objects/dictionaries

$
0
0

In my bash script I have a dictionary/map like:

k1: v1k2: v2k3: v3

Can I possibly use jq --slurp or jq --raw-input to actually convert this to JSON like this:

{"k1": "v1","k2": "v2","k3": "v3"}

possibly by piping something like: echo k1 v1 k2 v2 k3 v3 | jq [???]


Viewing all articles
Browse latest Browse all 657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>