Created
September 9, 2017 04:46
-
-
Save fervic/cebc8ecbd2c36077b470cea810a253b6 to your computer and use it in GitHub Desktop.
Stream S3 file contents to a UNIX pipe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
BUCKET=<bucket name> | |
PATH=<path to file(s)> | |
for key in `/usr/bin/aws s3api list-objects --bucket $BUCKET --prefix $PATH | /usr/bin/jq -r '.Contents[].Key'` | |
do | |
echo $key | |
/usr/bin/aws s3 cp s3://$BUCKET/$key - | /usr/bin/wc -l | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment