This is the script which I am trying to run
bRules=(`aws s3api get-bucket-lifecycle-configuration --bucket x | jq '.Rules[]'.ID`)
echo "*** Total number of LifecycleRules **** ${#bRules[@]}"
for rule in "${bRules[@]}"
do
echo "Bucket: x, Rule: $rule"
done
Actual output
*** Total number of LifecycleRules **** 6
Bucket: x, Rule: This
Bucket: x, Rule: is
Bucket: x, Rule: Rule-1
Bucket: x, Rule: This
Bucket: x, Rule: is
Bucket: x, Rule: Rule-2
Expected output:
*** Total number of LifecycleRules **** 2
Bucket: x, Rule: This is Rule-1
Bucket: x, Rule: This is Rule-2
What needs to be change in my code snippet to get the desired output? I'm kinda of lost to fix this issue.