LinuxQuestions.org

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

Fixit7 05-12-2014 12:27 PM

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 02: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 02:36 PM

have you tried
Code:

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

Fixit7 05-12-2014 03:55 PM

Thanks guys.

Script is working right.

Andy


All times are GMT -5. The time now is 08:15 PM.