Uncompress gzipped files

This commit is contained in:
Peter J. Holzer 2022-03-26 10:04:07 +01:00
parent e8c34ce1b5
commit 92125c7c4e
1 changed files with 6 additions and 1 deletions

View File

@ -4,7 +4,12 @@ use warnings;
open my $tsfh, '>', "graph_used.tsv";
for my $fn (glob("/var/log/simba/ca.*")) {
open (my $fh, '<', $fn);
my $fh;
if ($fn =~ /\.gz$/) {
open($fh, '-|', "zcat", $fn);
} else {
open ($fh, '<', $fn);
}
my %free;
while (<$fh>) {
if (m{(....-..-..T..:..:..[-+]....) .*: considering base /backup/(.*) \(est. (\d+) bytes\)}) {