1

I have did a curl request and get the response bellow:

$ curl -s http://xx.com/api
$ {"key":"value"}

How can I get the value directly from the request? Like this:

$ curl -s http://xx.com/api | XXXX
$ value
lucapette
  • 20,564
  • 6
  • 65
  • 59
fannheyward
  • 18,599
  • 12
  • 71
  • 109
  • You should probably look at this question: http://stackoverflow.com/questions/3919750/parse-json-with-shell-scripting-at-linux – Hobblin Dec 03 '11 at 16:18

1 Answers1

1
curl -s http://xx.com/api | sed 's/.*:"\(.*\)".*/\1/'
DejanLekic
  • 18,787
  • 4
  • 46
  • 77