Would be nice if `curl` had something to dump headers to a third file descriptor while outputting the response on stdout.
Re:What does " 2>&1 " mean?
by homebrewer on Friday February 27, 2026 @03:38AM
(#47178131)
This 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.Ah yeah, `/dev/fd/xxx` works :) somehow thought that was Linux only.
You can, though, do the following:
This will pipe only the object contents to stdout, and the API response to /dev/null.