#!/usr/bin/perl -w $|++; use strict; my (@list, $d, $i); die "Need Directory Param!\n" unless $ARGV[0]; my $cmd = qq/tar -zxvf/; opendir LOCAL,$ARGV[0]; @list = readdir LOCAL; foreach $d (0..$#list) { if($list[$d] =~ /.+\.tar\.gz/) { qx/$cmd $list[$d]/; $i++; } elsif($list[$d] =~ /.+\.tgz/) { qx/$cmd $list[$d]/; $i++; } } print "$i files expanded!\n"; closedir LOCAL;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Yet Another Tar-Gzip File Expander
by thelenm (Vicar) on May 13, 2002 at 22:22 UTC | |
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 | |
by straywalrus (Friar) on May 13, 2002 at 22:33 UTC |