0
我想在終端中使用jq
來處理我的json
文件。我想這個命令:在命令行終端中解析json
cat json.txt | jq 'name'
它顯示我
-bash: /usr/bin/jq: cannot execute binary file
預期結果:
Google
其中json.txt
確實是一個有效的json
文件。我試圖檢查是否正確安裝了jq
。下面是我得到:
brew install jq
它顯示我:
Warning: jq-1.3 already installed
我使用mac
。任何人有任何想法?該json.txt
文件是:
{
"name": "Google",
"location":
{
"street": "1600 Amphitheatre Parkway",
"city": "Mountain View",
"state": "California",
"country": "US"
},
"employees":
[
{
"name": "Michael",
"division": "Engineering"
},
{
"name": "Laura",
"division": "HR"
},
{
"name": "Elise",
"division": "Marketing"
}
]
}