From c640a74c9c4f7b21b53df896d69f7584e8d5a199 Mon Sep 17 00:00:00 2001 From: Darold Gilles Date: Sun, 3 Mar 2013 10:51:58 +0100 Subject: [PATCH] Add missing zcat command control in previous patch. --- pgbadger | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pgbadger b/pgbadger index 0e4192b..4f63ff8 100755 --- a/pgbadger +++ b/pgbadger @@ -110,7 +110,8 @@ $| = 1; my $JQGRAPH = 1; # Command line options -my $zcat = 'gunzip -c'; +my $zcat_cmd = 'gunzip -c'; +my $zcat = $zcat_cmd; my $bzcat = 'bunzip2 -c'; my $ucat = 'unzip -p'; my $gzip_uncompress_size = "gunzip -l %f | grep -E '^\\s*[0-9]+' | awk '{print \$2}'"; @@ -6093,9 +6094,9 @@ sub get_log_file } else { my $uncompress = $zcat; - if (($logf =~ /\.bz2/i) && ($zcat =~ /^zcat$/)) { + if (($logf =~ /\.bz2/i) && ($zcat =~ /^$zcat_cmd$/)) { $uncompress = $bzcat; - } elsif (($logf =~ /\.zip/i) && ($zcat =~ /^zcat$/)) { + } elsif (($logf =~ /\.zip/i) && ($zcat =~ /^$zcat_cmd$/)) { $uncompress = $ucat; } &logmsg('DEBUG', "Compressed log file, will use command: $uncompress \"$logf\""); -- 2.40.0