-   Puppy (
-   -   Suppress message from zip (

Fixit7 05-12-2014 11:27 AM

Suppress message from zip
I would to suppress the error message when there are no doc files present.

I have this, but it does not work.

zip -u Linux_Documents *.txt *.doc *.rtf 2&>1 > /dev/null
I understand that errors are written to stderr "2"

goumba 05-12-2014 01:36 PM

You have the ampersand and the redirection in the wrong places. Note the ampersand follows the bracket.



zip -u Linux_Documents *.txt *.doc *.rtf > /dev/null 2>&1

The post below mine redirects only stderr to /dev/null. So if there's output to stdout you will see it. My example above will redirect both stderr and stdout to /dev/null so you will get no output whatsoever.

ondoho 05-12-2014 01:36 PM

have you tried

zip -u Linux_Documents *.txt *.doc *.rtf 2>/dev/null

Fixit7 05-12-2014 02:55 PM

Thanks guys.

Script is working right.


All times are GMT -5. The time now is 09:17 AM.