Re: perl: how to suppress system()'s output or quiet down `tar`
On Sat, Jan 13, 2007 at 01:07:28PM +0100, LeVA wrote:
> Hi!
>
> From a perl script I call 'tar' with system(). But with every system()
> call I get the output from tar to my console: "tar: Removing leading /
> from absolute path names in the archive" and it messes up my perl
> script's output. I understand why tar is saying this, but I can not use
> the -P switch, because I need tar to remove the leading '/'s, and there
> is no "quiet" switch to tar. Is there a solution? Can I quiet down tar,
> or suppress system()'s output?
>
I don't do perl, I do python. AFAIK, system() runs something on the
system but doesn't do anything with the output so I goes where it
normally would. I don't know whether the "Removing leading..." messages
are on stdout or sterr. I would use popen and capture the output so it
doesn't go to the screen.
Doug.
Reply to: