#! /usr/bin/env bash # to make this blubage easier to read ... WHITE="97" BOLDWHITE="\e[1;${WHITE}m" ENDCOLOR="\e[0m" # list buckets and loop aws s3api list-buckets --query 'Buckets[].[Name]' --output text | while read bucket ; do echo "${BOLDWHITE}${bucket}${ENDCOLOR}" aws s3api get-bucket-lifecycle-configuration --bucket $bucket echo "" done