Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- buckets=$(aws s3api list-buckets --region eu-west-1 --query Buckets[].[Name] --output text)
- while read -r line ; do aws s3 rb s3://$line --force; done <<< "$buckets"
- Alernative:
- PREFIX=blog
- BUCKETS=$(aws s3 ls | grep $PREFIX | awk '{print $3}')
- echo $BUCKETS| while read BUCK; do aws s3 rb $BUCK --force; done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement