Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

OT - tar: Removing '/' from member names

by kumar
on Feb 18, 2003 at 17:56 UTC ( #236336=perlquestion: print w/replies, xml ) Need Help??

kumar has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I have a script written in perl and executed in the command prompt. While executing the script it works properly, but shows some error message.


system ` tar -cz /usr/fweb/xyz/abc > /usr/fweb/xyz/aa.tar.gz `;
This is fine - tar file is created, but getting this display as
"tar: Removing '/' from member names".
How can i eliminate this display?
Can anyone pls help me to tackle this problem.

update (broquaint): added formatting and marked off-topic

Replies are listed 'Best First'.
Re: tar: Removing '/' from member names
by Paladin (Vicar) on Feb 18, 2003 at 18:09 UTC
    The message tar: Removing '/' from member names is being output by tar to stderr. You can redirect stderr on the command like with something like this:
    tar -cz /usr/fweb/xyz/abc > /usr/fweb/xyz/aa.tar.gz 2> /dev/null

    The 2> redirects stderr the same way > redirects stderr. So the above command is telling the shell to send stderr to /dev/null which on most systems, just throws it away.

    Put that command in your `` in your script, and see if it works.

      Thanks lot for your help. It's working properly. Regards, kumar
Re: tar: Removing '/' from member names
by jmcnamara (Monsignor) on Feb 18, 2003 at 18:07 UTC

    This message comes from tar and not from perl.

    If you wish to keep the root "/" then have a look at the -P switch in the tar manpage:

    tar -Pcz /usr/fweb/xyz/abc > /usr/fweb/xyz/aa.tar.gz or tar -Pczf /usr/fweb/xyz/aa.tar.gz /usr/fweb/xyz/abc


Re: tar: Removing '/' from member names
by feanor_269 (Beadle) on Feb 18, 2003 at 18:14 UTC
    You seem to be using linux or unix paths on a windows system... could that be the issue? or am I not seeing the real problem here?

      You are not seeing the real issue here. It's a real tar warning, which has all to do with the content, and the euid of the person untarring it.

      The question itself has nothing to do with Perl though.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://236336]
Approved by Paladin
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2021-01-21 15:37 GMT
Find Nodes?
    Voting Booth?