When I run the code below, it's iterating over each word in the key .serverParams
instead of each instance of the key. (Echoing the line is not my ultimate intent, but just using it so I can see the output of each iteration)
for i in $(jq -r .servers[].serverParams ./servers.json);
do echo "$i";
done
I can get my intended result with the following but it seems clunky:
for k in $(jq '.servers | keys| .[]' ./servers.json);
do jq .servers[$k].serverParams ./servers.json;
done