in reply to Yet Another Tar-Gzip File Expander
Update: fixed a typo as pointed out by straywalrus.#!/usr/bin/perl -w $|++; use strict; my $total=0; my $dir = shift || die "Needs Directory Param!\n"; opendir LOCAL,$dir or die "Can't open directory '$dir': $!\n"; while (my $file = readdir LOCAL) { next unless $file =~ /\.t(?:ar\.)?gz\z/; system("tar", "xzvf", "$dir/$file"); $total++; } closedir LOCAL; print "$total files expanded!\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Yet Another Tar-Gzip File Expander
by straywalrus (Friar) on May 14, 2002 at 01:34 UTC | |
by Anonymous Monk on May 14, 2002 at 01:53 UTC | |
by thelenm (Vicar) on May 14, 2002 at 03:48 UTC | |
by straywalrus (Friar) on May 14, 2002 at 19:39 UTC | |
|
Re: Re: Yet Another Tar-Gzip File Expander
by straywalrus (Friar) on May 13, 2002 at 22:33 UTC |