The contents of all the file objects have to be dumped to stdout
Pass “-” for destination of aws s3 cp command to obtain this. For instance, $ aws s3 cp s3://mybucket/stream.txt
What you're trying to do is something like this? ::
#!/bin/bash
BUCKET=your-bucket-name
for key in `aws s3api list-objects --bucket $BUCKET --prefix bucket/path/to/files/ | jq -r '.Contents[].Key'`
do
echo $key
aws s3 cp s3://$BUCKET/$key - | md5sum
Done