4 ms·
The aws cli has a set of porcelain for s3 access (aws s3) and plumbing commands for lower level access to advanced controls (aws s3api). The plumbing command aw
by nothrabannosir 7mo ago
The aws cli has a set of porcelain for s3 access (aws s3) and plumbing commands for lower level access to advanced controls (aws s3api). The plumbing command aws s3api get-object doesn't support stdout natively, so if you need it and want to use it in a pipeline (e.g. pv), you would naively do something like
$ aws s3api get-object --bucket foo --key bar /dev/stdout | pv ...
Unfortunately, aws s3api already prints the API response to stdout, and error messages to stderr, so if you do the above you'll clobber your pipeline with noise, and using /dev/stderr has the same effect on error.
You can, though, do the following:
$ aws s3api get-object --bucket foo --key bar /dev/fd/3 3>&1 >/dev/null | pv ...
This will pipe only the object contents to stdout, and the API response to /dev/null.
- stabbles 7mo agoWould be nice if `curl` had something to dump headers to a third file descriptor while outputting the response on stdout.
- deleted 7mo ago[deleted]
- homebrewer 7mo agoThis should work? curl --dump-header /dev/fd/xxx https://google.com or mkfifo headers.out curl --dump-header headers.out https://google.com unless I'm misunderstanding you.