Skip to main content
Question Protected by miken32
spelling, wording,
Source Link
Matthias Braun
  • 34.8k
  • 27
  • 158
  • 177

Curl Display curl output to display in the readable JSON format in UNIXUnix shell script

In my UNIXUnix shell script, when iI execute a curl command, my curlthe result will be displayed as below which iI am redirecting it to file:

{"type":"Show","id":"123","title":"name","description":"Funny","channelTitle":"ifood.tv","lastUpdateTimestamp":"2014-04-20T20:34:59","numOfVideos":"15"} 

But, I want this output to put in the readable JSON format like below in the file:

{"type":"Show", "id":"123", "title":"name", "description":"Funny", "channelTitle":"ifood.tv", "lastUpdateTimestamp":"2014-04-20T20:34:59", "numOfVideos":"15"} 

Pls suggestHow do I format the output this way?

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

In my UNIX shell script, when i execute a curl command, my curl result will be displayed as below which i am redirecting it to file:

{"type":"Show","id":"123","title":"name","description":"Funny","channelTitle":"ifood.tv","lastUpdateTimestamp":"2014-04-20T20:34:59","numOfVideos":"15"} 

But, I want this output to put in the readable JSON format like below in the file:

{"type":"Show", "id":"123", "title":"name", "description":"Funny", "channelTitle":"ifood.tv", "lastUpdateTimestamp":"2014-04-20T20:34:59", "numOfVideos":"15"} 

Pls suggest

Display curl output in readable JSON format in Unix shell script

In my Unix shell script, when I execute a curl command, the result will be displayed as below which I am redirecting to file:

{"type":"Show","id":"123","title":"name","description":"Funny","channelTitle":"ifood.tv","lastUpdateTimestamp":"2014-04-20T20:34:59","numOfVideos":"15"} 

But, I want this output to put in the readable JSON format like below in the file:

{"type":"Show", "id":"123", "title":"name", "description":"Funny", "channelTitle":"ifood.tv", "lastUpdateTimestamp":"2014-04-20T20:34:59", "numOfVideos":"15"} 

How do I format the output this way?

added 32 characters in body
Source Link
Gilles Quénot
  • 188k
  • 43
  • 232
  • 229

In my UNIX shell script, when i execute a curl command, my curl result will be displayed as below which i am redirecting it to file:

{"type":"Show","id":"123","title":"name","description":"Funny","channelTitle":"ifood.tv","lastUpdateTimestamp":"2014-04-20T20:34:59","numOfVideos":"15"}

{"type":"Show","id":"123","title":"name","description":"Funny","channelTitle":"ifood.tv","lastUpdateTimestamp":"2014-04-20T20:34:59","numOfVideos":"15"} 

But, I want this output to put in the readable JSON format like below in the file:

{"type":"Show", "id":"123", "title":"name", "description":"Funny", "channelTitle":"ifood.tv", "lastUpdateTimestamp":"2014-04-20T20:34:59", "numOfVideos":"15"}

{"type":"Show", "id":"123", "title":"name", "description":"Funny", "channelTitle":"ifood.tv", "lastUpdateTimestamp":"2014-04-20T20:34:59", "numOfVideos":"15"} 

Pls suggest

In my UNIX shell script, when i execute a curl command, my curl result will be displayed as below which i am redirecting it to file:

{"type":"Show","id":"123","title":"name","description":"Funny","channelTitle":"ifood.tv","lastUpdateTimestamp":"2014-04-20T20:34:59","numOfVideos":"15"}

But, I want this output to put in the readable JSON format like below in the file:

{"type":"Show", "id":"123", "title":"name", "description":"Funny", "channelTitle":"ifood.tv", "lastUpdateTimestamp":"2014-04-20T20:34:59", "numOfVideos":"15"}

Pls suggest

In my UNIX shell script, when i execute a curl command, my curl result will be displayed as below which i am redirecting it to file:

{"type":"Show","id":"123","title":"name","description":"Funny","channelTitle":"ifood.tv","lastUpdateTimestamp":"2014-04-20T20:34:59","numOfVideos":"15"} 

But, I want this output to put in the readable JSON format like below in the file:

{"type":"Show", "id":"123", "title":"name", "description":"Funny", "channelTitle":"ifood.tv", "lastUpdateTimestamp":"2014-04-20T20:34:59", "numOfVideos":"15"} 

Pls suggest

Source Link
Jams
  • 4.2k
  • 3
  • 20
  • 13

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

In my UNIX shell script, when i execute a curl command, my curl result will be displayed as below which i am redirecting it to file:

{"type":"Show","id":"123","title":"name","description":"Funny","channelTitle":"ifood.tv","lastUpdateTimestamp":"2014-04-20T20:34:59","numOfVideos":"15"}

But, I want this output to put in the readable JSON format like below in the file:

{"type":"Show", "id":"123", "title":"name", "description":"Funny", "channelTitle":"ifood.tv", "lastUpdateTimestamp":"2014-04-20T20:34:59", "numOfVideos":"15"}

Pls suggest