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 jq using identity filter :
curl ... | jq '.' 
curl ... | node <<< "var o = $(cat); console.log(json.stringify(o, null, 4));"
Comments
Post a Comment