Don't know if anyone can use this, but I wish I had it a long time
ago.  I always get screwed when I untar a tarred file, and it dumps
into the current directory instead of into a new directory.  I could
check the contents first, but I'm too lazy.  :)

So, if this ever happens, run this command to dump the contents of
the tar into a file:

tar -tf filename.tar > temptarfile

or if it's gzipped, add a 'z'.

Then you can use this script to delete all the files by running this
command:

perl remove.pl temptarfile

Here's the perl script:

#!/usr/bin/perl -w

if ($ARGV[0] eq '')
{
        print "\nMust specify a file.";
        exit (0);
}
                                                                
open (TMP, $ARGV[0]) || die "Can't open file: $!";
my @files = <TMP>;
close (TMP);
                                                                
foreach $file (@files)
{
              chomp $file;
        system ("rm -f $file");
}

-Rob.

Reply via email to