Created attachment 1434 [details] only disable the progress meter, keep error messages The man page says -q disables the progress meter, but it also disables all other output. $ scp -q badhost:/bin/ls . $ scp badhost:/bin/ls . ssh: badhost: Name or service not known I would like -q to disable the progress meter as documented (I don't see the point of a -q flag if all it does is discards stderr, since I can already do that with my shell), but you might prefer to update the man page to reflect the current behavior instead. Tested with openssh-4.7p1 on Fedora.
Created attachment 1435 [details] alternative: update the man page to reflect current behavior
I tested the first patch briefly. It fixes my test case and seems to be the obvious change. I haven't tested the second patch. It just changes the man page. The third option is to take a deeper look at the behavior of -q in all of OpenSSH. My ideal would be that -q turns off things like banners but still prints errors. That way I could run cron jobs using scp and/or ssh and only get emailed if something broke.
It seems the behavior was changed in 2003. It used to do what the man page said, but it got changed to turn off all stderr output. The intent was to disable banners, but it also silences any errors, which I think is undesirable. revision 1.121 date: 2003/11/17 10:19:05; author: djm; state: Exp; lines: +2 -1 - dtucker@cvs.openbsd.org 2003/11/12 10:12:15 [scp.c] When called with -q, pass -q to ssh; suppresses SSH2 banner. ok markus@
Created attachment 1436 [details] better: make -q show only critical messages in ssh and scp This changes -q to suppress all messages below SYSLOG_LEVEL_FATAL. This gives us: - no progress bar (as documented) - no banners (as per Darren Tucker's patch that was already committed) - messages if the connection fails
Created attachment 1437 [details] better: make -q show only critical messages in ssh and scp Previous patch plus a minor change to clientloop.c just in case somebody decides to change SYSLOG_LEVEL_QUIET at a later date.
The scp manual page has been updated to reflect the true behaviour. BTW I think having -q consistent between ssh and scp is desirable.
Fix shipped in 4.9/4.9p1 release.