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

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: tar options
by saintmike (Vicar) on Nov 14, 2005 at 07:02 UTC
    To give your question at least a tiny perl slant:
    use Sysadm::Install qw(untar_in); untar_in("tarball.tgz", "directory");
Re: tar options
by gam3 (Curate) on Nov 14, 2005 at 15:50 UTC
    I don't think that there is anyway to do this with tar. What you can do is rename the directory right after you extract the archive.

    The code below will work for tars that have a single directory in them.

    #!/usr/bin/perl my $name = "xxxx.tar"; my $oldname = "xxxx"; my $newname = "myxx"; mkdir "_extract"; system("tar -C _extract -xf $name"); rename "_extract/$oldname", "$newname"; rmdir "_extract";
    -- gam3
    A picture is worth a thousand words, but takes 200K.
Re: tar options
by spiritway (Vicar) on Nov 14, 2005 at 05:53 UTC

    Try 'man tar'.