paint-brush
Quickly JSON.parse() on command lineby@garciaj.uk
2,102 reads
2,102 reads

Quickly JSON.parse() on command line

by Short Tech StoriesMay 30th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

I was trying to get some data out of <strong>etcd </strong>(<strong>kubernetes</strong>) and i found the value was returned as a string:
featured image - Quickly JSON.parse() on command line
Short Tech Stories HackerNoon profile picture

I was trying to get some data out of etcd (kubernetes) and i found the value was returned as a string:

you can see the quotes in the beginning, so after playing with sed for a bit , getting me nowhere , i discovered the -r flag of jq so…

As you can see now you have a json object back that we can pass back to jq:

just that.

Thank you.