If I run the command s3cmd get s3://bucket/file.gz -
I get binary output on the screen. If I try to pipe this to gzip with s3cmd get s3://bucket/file.gz - | zcat
I get gzip: stdin: not in gzip format
.
How can I get zcat
to pick it's input from stdin
?
gzip
and its auxilliary commands all read from STDIN by default. We can test this with a really simple test:Or something more exotic to prove that wasn't a fluke:
That suggests to me that your
s3cmd
output is dirty or malformed in some way. Try redirecting to file (rather tha providing a real filename) and then looking at the output in something likehead
. Or download it properly and compare.