【发布时间】:2016-12-06 07:20:15
【问题描述】:
如何使用 shell 脚本从以下 json 数据中解析字符串 'key' 的值?
/Users/local/Documents/testjira:{"expand":"schema","names","startAt":"0","maxResults":"50","total":"2","issues":[{"expand":"operations","editmeta","changelog","transitions","renderedFields","id":"56392","self":"https://website.com/jira/rest/api/latest/issue/50342","key":"SAR-32"},{"expand":"operations","editmeta","changelog","transitions","renderedFields","id":"49799","self":"https://website.com/jira/rest/api/latest/issue/19720","key":"SAR-5"}]}
示例输出: SAR-32、SAR-5 等等..
【问题讨论】:
-
使用合适的
json解析工具,比如jq