LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Puppy (https://www.linuxquestions.org/questions/puppy-71/)
-   -   Suppress message from zip (https://www.linuxquestions.org/questions/puppy-71/suppress-message-from-zip-4175504736/)

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.
Code:

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.

Try

Code:

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

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
Code:

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

Fixit7 05-12-2014 02:55 PM

Thanks guys.

Script is working right.

Andy


All times are GMT -5. The time now is 04:30 AM.