I need to execute cat build.json | jq '.Stage*.Name'
for 5 times, where *
is a number from 1 to 5.
I tried this:
for (( c=1; c<5; c++ ))
do
echo $c
cat build.json | jq '.Stage${c}.Name'
done
And I got this error:
jq: error: syntax error, unexpected '$', expecting $end (Unix shell quoting issues?) at <top-level>, line 1:
.Stage${c}.Name
jq: 1 compile error
How do I do this properly?