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

Re^2: creating .tar.gz file

by narainhere (Monk)
on Oct 31, 2007 at 12:23 UTC ( [id://648233]=note: print w/replies, xml ) Need Help??


in reply to Re: creating .tar.gz file
in thread creating .tar.gz file

The second solution looks promising, some time back I was to do the same, here it goes
$cmd="tar -cvf xyz.tar xyz.txt 2>&1"; system($cmd);
This creates a archive named xyz.tar containing xyz.txt then
$cmd="gzip xyz.tar 2>&1"; system($cmd);
will create the xyz.tar.gz file for you!!

The world is so big for any individual to conquer

Replies are listed 'Best First'.
Re^3: creating .tar.gz file
by bart (Canon) on Oct 31, 2007 at 12:42 UTC
    If your tar supports it, the you can make tar directly invoke gzip in one command, creating a .tar.gz file in one go, using the -z command line switch.
Re^3: creating .tar.gz file
by Bloodnok (Vicar) on Oct 31, 2007 at 13:46 UTC
    ... or even (from memory, which at my time of life ain't what it used to be) ...

    `tar -cv xyz.txt | gzip -c > xyz.tgz`;
    At last, a user level that best describes my experience :-))

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://648233]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-23 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found