how to count number of json objects present in json array in shell script code example
Example: jq count outputs
echo '[{"username":"user1"},{"username":"user2"}]' | jq '. | length'
> 2
echo '[{"username":"user1"},{"username":"user2"}]' | jq '. | length'
> 2