0

So, I am writing a shell script and I am running a command that gives me an output like:

{"a":"some_text","b":some_other_text","c":"even_more_text"}

Now, I am not sure how to parse it, I basically need the value of "c", i.e. "ever_more_text" in a variable, but finding out results on internet have not worked yet! TIA.

Pensu
  • 3,263
  • 10
  • 46
  • 71

1 Answers1

0

the output which you paste here is not valid json. Check with https://jsonformatter.curiousconcept.com/ There is missing first double quote in "some_other_text". If you add it, you can then easily parse with jq:

./your_script.sh | jq -r ".c"
lojza
  • 1,823
  • 2
  • 13
  • 23