Skip to content

Commit 63fdc36

Browse files
authored
Update s3-functions
grep for filters
1 parent ee283f9 commit 63fdc36

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/s3-functions

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,18 @@ bucket-objects() {
6565
#
6666

6767
local buckets=$(skim-stdin "$@")
68+
local filters=$(__bma_read_filters $@)
69+
6870
[[ -z "$buckets" ]] && __bma_usage "bucket [bucket]" && return 1
6971

7072
local bucket
7173
for bucket in $buckets; do
7274
aws s3api list-objects \
7375
--bucket "$bucket" \
7476
--output text \
75-
--query "Contents[].[Key, LastModified, StorageClass, Owner.DisplayName, ETag, Size]"
77+
--query "Contents[].[Key, LastModified, StorageClass, Owner.DisplayName, ETag, Size]"
78+
grep -E -- "$filters"
79+
# We're not passing through `column` as there may be millions so we want immediate output
7680
done
7781
}
7882

0 commit comments

Comments
 (0)