Open cluck opened 2 weeks ago
This sounds good, can you please submit a PR suggesting an update to the README.md
? Maybe leave the zgrep
instruction in place but also include this new version?
Actually, what is the reason for requiring zgrep version 1.12?
I tested on Ubuntu 20.04.5 again, and both zgrep and zcat|grep happily match this test case:
echo "INSERT INTO bla VALUES ('a', 2, '3:0:01234567890abcdef');" | gzip > test.sql.gz
zgrep -P "VALUES\s*\(.*\d:\d:...*'" test.sql.gz
zcat test.sql.gz | grep -P "VALUES\s*\(.*\d:\d:...*'"
Moreover, -P
is an option that zgrep passes to grep, which comes with it's own version:
On Ubuntu 20.04.5:
Pinging @jellesiderius, who introduced the comment in the readme — Thanks, Claudio
Unfortunately I can't validate my two alternatives, as I lack information about the original problem with older zgrep versions.
I think my alternatives are perfect replacements, but then again, my test works with older zgrep too, so I must be missing the entire point.
Ubuntu 20.04.5 LTS still has zgrep version 1.10.
Maybe
zgrep -P PATTERN file.gz
can be replaced byzcat file.gz | perl -nle 'print if m{PATTERN}'
?More specifically
zcat file.gz | perl -nle "print if m{VALUES\s*\(.*\d:\d:...*'}"