Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Puppy
User Name
Puppy This forum is for the discussion of Puppy Linux.


  Search this Thread
Old 05-12-2014, 12:27 PM   #1
Senior Member
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate
Posts: 1,254

Rep: Reputation: 162Reputation: 162
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"
Old 05-12-2014, 02:36 PM   #2
Senior Member
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian Sid. Arch. FreeBSD. I really like DNF, but Fedora just doesn't like me.
Posts: 1,078
Blog Entries: 6

Rep: Reputation: 284Reputation: 284Reputation: 284
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.

Last edited by goumba; 05-12-2014 at 02:42 PM.
Old 05-12-2014, 02:36 PM   #3
Senior Member
Registered: Dec 2013
Posts: 4,351

Rep: Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887
have you tried
zip -u Linux_Documents *.txt *.doc *.rtf 2>/dev/null
Old 05-12-2014, 03:55 PM   #4
Senior Member
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate
Posts: 1,254

Original Poster
Rep: Reputation: 162Reputation: 162
Thanks guys.

Script is working right.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux zip program's -d -tt option deletes all files from zip archive Arun Gupta Linux - Software 4 04-27-2011 08:06 PM
Strange warning message when accessing zip files on specific samba share bdb4269 Linux - General 4 01-31-2011 03:26 PM
suppress known warning message powah Programming 4 11-17-2007 09:34 PM
How to suppress particular warning message? hottdogg Programming 3 03-02-2007 02:15 AM
sending html text message with zip file attachment; Content-Type: multipart/mixed phelpsj Programming 1 06-22-2006 09:50 AM

All times are GMT -5. The time now is 01:13 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration