不太熟悉自制。我试图通过运行jq将其评级从1.6降到1.3.1
brew install jq@1.3.1
但我一直在接受
Warning: No available formula with the name "jq@1.3.1".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No
我有一个jenkins JSON API,它将输出存储在变量data中
{"credentials":{"xxxxxxxxxxxxxx111":{},"xxxxxxxxxxxx2222":{}},"description":"All credentials that are not bound to a specific domain.","displayName":"Global credentials","fullDisplayName":"Credent
我正在尝试使用bash过滤json文件,该文件可能类似于:
{
"key1": [],
"key2":["first_value","second_value"]
}
如果我想获取key1和key2,我可以这样做:
if $(cat $my_json | jq 'has("key1")'); then
values=$(jq -r ".key1" "$my_json")
for item in $values
do
echo