LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy
User Name
Password
Puppy This forum is for the discussion of Puppy Linux.

Notices



Reply
 
Search this Thread
Old 05-12-2014, 12:27 PM   #1
Fixit7
Member
 
Registered: Mar 2014
Posts: 311

Rep: Reputation: 1
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"
 
Old 05-12-2014, 02:36 PM   #2
goumba
Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian Wheezy (7.0), Jessie (future 8) and Sid (unstable)
Posts: 572
Blog Entries: 3

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

Last edited by goumba; 05-12-2014 at 02:42 PM.
 
Old 05-12-2014, 02:36 PM   #3
ondoho
Senior Member
 
Registered: Dec 2013
Distribution: arch linux / crunchbang
Posts: 1,216

Rep: Reputation: 170Reputation: 170
have you tried
Code:
zip -u Linux_Documents *.txt *.doc *.rtf 2>/dev/null
 
Old 05-12-2014, 03:55 PM   #4
Fixit7
Member
 
Registered: Mar 2014
Posts: 311

Original Poster
Rep: Reputation: 1
Thanks guys.

Script is working right.

Andy
 
  


Reply


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 09:40 PM.

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