Curl output to display in the readable JSON format in UNIX shell script -


in unix shell script, when execute curl command, curl result displayed below redirecting file:

{"type":"show","id":"123","title":"name","description":"funny","channeltitle":"ifood.tv","lastupdatetimestamp":"2014-04-20t20:34:59","numofvideos":"15"} 

but, want output put in readable json format below in file:

{"type":"show", "id":"123", "title":"name", "description":"funny", "channeltitle":"ifood.tv", "lastupdatetimestamp":"2014-04-20t20:34:59", "numofvideos":"15"} 

pls suggest

try doing :

curl ... | json_pp  

or using identity filter :

curl ... | jq '.' 

enter image description here

or , :

curl ... | node <<< "var o = $(cat); console.log(json.stringify(o, null, 4));" 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -