I want to use jq for processing my json file in terminal. I am trying this command:
cat json.txt | jq 'name'
it's showing me
-bash: /usr/bin/jq: cannot execute binary file
Expected result:
Google
where json.txt is indeed a valid json file. I tried to check whether jq is installed correctly. Here's what I am getting:
brew install jq
it's showing me:
Warning: jq-1.3 already installed
I am using mac. Anybody has any idea? The json.txt file is:
{
"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"
}
]
}