my $xzcat = 'xzcat';
my $gzip_uncompress_size = "gunzip -l %f | grep -E '^\\s*[0-9]+' | awk '{print \$2}'";
my $zip_uncompress_size = "unzip -l %f | awk '{if (NR==4) print \$1}'";
-my $xz_uncompress_size = "xz -l %f | grep %f | awk '{print \$5}'";
+my $xz_uncompress_size = "xz --robot -l %f | grep totals | awk '{print \$5}'";
my $format = '';
my $outfile = '';
my $outdir = '';
my $cmd_file_size = $gzip_uncompress_size;
if ($logf =~ /\.zip/i) {
$cmd_file_size = $zip_uncompress_size;
- }
- if ($logf =~ /\.xz/i) {
+ } elsif ($logf =~ /\.xz/i) {
$cmd_file_size = $xz_uncompress_size;
}
$cmd_file_size =~ s/\%f/$logf/g;