All Questions

Tagged with
Filter by
Sorted by
Tagged with
1
vote
1answer
64 views

Convert JSON with raw characters in string

Had a problem with a tool that was generating illegal JSON. Some of the JSON strings contained characters in the range 00-1f. So I wanted to convert these characters to correctly escaped valued \...
0
votes
1answer
380 views

Interpolate within single quotes

I have the following: COMMENT="A random comment" TEXT_JSON='{"person" : "Jim","comment" : "$COMMENT"}' echo "$TEXT_JSON" | jq . This prints { "person": "Jim", "comment": "$...
0
votes
2answers
1k views

Is it possible to not escape double quotes and get the right json format?

I want to submit json data using httpie. If I use double quotes and escape the double quotes surrounding the key, it works. json="[ \ { \ \"count\": 3 \ } \ ]" echo $json [ { "...