简体   繁体   English

如何从shell脚本获取dict值?

[英]How to get dict value from shell script?

I have did a curl request and get the response bellow: 我做了一个curl请求并得到以下响应:

$ 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
curl -s http://xx.com/api | sed 's/.*:"\(.*\)".*/\1/'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM