Search code examples
bashstdoutunzipstderr

How to avoid unzip "archives were successfully processed." output


When using the unzip command in bash, a lot of output in the terminal is created. Some output can be suppressed by using the -q option or the -qq ("= even quieter" - UNZIP MAN). However, always a the end of the process I still get a message like 10 archives were successfully processed (and with an empty line before it).

It seems like this message is from the STDERR, because when I output the STDOUT to a file like

unzip -qq files2zip.zip 1> stdoutput.txt

It still is outputted to the terminal and not the file. When I output the STDERR (i.e., 2> stderror.txt)to a file, it does get outputted to the file.

In my script I want errors to be shown on the screen, but I don't want this message to appear. So is there any way to suppress this message without losing the output of the errors (I don't want to output the stderr to a file)?


Solution

  • You can use proc sub

    unzip -qq files2zip.zip 2> >(grep -v "were successfully processed")