This is an example AWS CLI script:
taskDefs=$(aws ecs list-task-definitions --status="INACTIVE" --query="taskDefinitionArns")
echo $taskDefs
# output: ["arn:1", "arn:2", "arn:3"]
This outputs exactly the same:
echo $taskDefs[0]
# output: ["arn:1", "arn:2", "arn:3"]
I want to iterate over the results but it seems to just echo the entire array.
for value in "${taskDefs[@]}"
do
echo "value=$value"
done
# output: value=["arn:1", "arn:2", "arn:3"]
I want it to output:
value="arn:1"