I'm trying to print just the verbose sections of a cURL request (which are sent to stderr) from the bash shell.
But when I redirect stdout like this:
curl -v http://somehost/somepage > /dev/null
Some sort of results table appears in the middle of the output to stderr:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Followed by this near the end:
{ [data not shown]
118 592 0 592 0 0 15714 0 --:--:-- --:--:-- --:--:-- 25739
Which makes the response headers less readable.
I don't see this text when not redirecting.
Another way to see the effects:
Table doesn't appear:
curl -v http://somehost/somepage 2>&1
Table appears:
curl -v http://somehost/somepage 2>&1 | cat
How come this shows up only with certain types of redirects?
What's the neatest way to suppress it?
-sbut without-vyou will not see errors such as failure to connect. For that you should also add-S(or--show-error) as in mhoydis's answer. – Artyom Apr 14 '14 at 09:47curltojq. No progress bar without piping tojq, then when piping tojqI have to go back and add-s. – sixty4bit Jul 29 '19 at 17:54STDOUTisn't a tty. When output is not being piped, you don't want progress information to be interspersed with normal output, which you can see and have some idea of progress. When output is redirected or piped, you can't see it so you have no gauge for progress - unless the progress bar is turned on. – Dennis Williamson Jul 29 '19 at 20:18