0
I would like to take the size of a vector in a JSON in the scriipt shell but I’m only able to get the size of each vector string, that is, for the example :
#!/bin/bash
j='{"Nomes": { "nome": ["maria", "jose", "vitor","caio"] }}'
echo $j
echo $j | jq -r ".Nomes | .nome[] | length"
Comes out beyond JSON:
5
4
5
4
But I wanted to know 4 that is the amount of items in the vector.