LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 05-02-2005, 06:24 PM   #1
marri
Member
 
Registered: May 2004
Posts: 38

Rep: Reputation: 15
Suppressing the output from tar


hi
I've been dealing with quite a frustrating problem of redirection when using tar.
The problem is when I'm comparing if a certain file exists in a tar file. If the file doesn't exist I always get an error message saying that the file doesn't exists and such.

Even though I use redirection to /dev/null like:

Code:
tar -df TarFile.tar TestFile & > /dev/null
I always get the error message.

When the comparison is successful, I get no error message.

I basically don't want any extra output from tar.

Is there any way to suppress the error message?

regards
Marri
 
Old 05-02-2005, 06:36 PM   #2
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
try this:

Code:
tar -df TarFile.tar TestFile >/dev/null 2>&1
Thta oughta direct also standard error
 
Old 05-03-2005, 03:19 AM   #3
marri
Member
 
Registered: May 2004
Posts: 38

Original Poster
Rep: Reputation: 15
Hi
thanks alot Artanicus, that did the trick for me.
regards
Marri
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
tar and gzip - how do i point to a output directory RedHat123 Linux - Newbie 4 04-20-2011 10:48 AM
Vim: Suppressing display refresh? jonathantan86 Linux - Newbie 1 11-26-2005 10:44 AM
splitting tar output chakkerz Linux - Newbie 3 03-21-2004 09:47 PM
logging tar output chakkerz Linux - Newbie 2 03-09-2004 11:42 PM
suppressing boot output to terminal aethereal Linux - Newbie 2 12-23-2001 08:29 PM


All times are GMT -5. The time now is 05:31 AM.

Main Menu
 
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
Open Source Consulting | Domain Registration