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,249
  • 5
  • 64
  • 59
fannheyward
  • 17,178
  • 11
  • 66
  • 105
  • 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
  • 17,326
  • 3
  • 42
  • 73