[LA.pm] calling gzip from within perl

David Heayn david at cloudgraphics.com
Tue Jun 28 21:28:38 PDT 2005


I'm working with a script that needs to decompress log files before 
it can read them as text. I hope to use a system() command and I 
found this almost perfect snippet to place inside:

find . -name '*.gz' -print | sed 's/^\(.*\)[.]gz$/gunzip < "&" > "\1"/' | s
from http://www.gnu.org/software/gzip/manual/html_chapter/gzip_3.html#SEC6


This is great, however I really want to delete the all *.gz files 
once I'm done with them. Any suggestions? Or would you go an entirely 
different way?


David Heayn * http://www.cloudgraphics.com * 213/925.3283


More information about the Losangeles-pm mailing list