Oh – you might want to include the –keep-order option as well so your results come back in file input order.
From: Parallel [mailto:parallel-bounces+mec=stowers.org@gnu.org]
On Behalf Of Cook, Malcolm
Sent: Thursday, April 20, 2017 11:39 AM
To: 'Asif Iqbal' <vadud3@gmail.com>
Cc: 'parallel@gnu.org' <parallel@gnu.org>
Subject: RE: output of parallel pipe to another grep
Hi – redirect output as normal:
parallel ‘zgrep foo {} | grep bar | grep 192.168.1.100’ ::: 201612*.gz > grep_hits.txt
On Thu, Apr 20, 2017 at 11:45 AM, Cook, Malcolm <MEC@stowers.org> wrote:
Not as written if you want the 2nd and 3rd grep to have been parallelized.
As written, only the 1st zgrep will be.
Try this instead:
parallel ‘zgrep foo {} | grep bar | grep 192.168.1.100’ ::: 201612*.gz
right make sense, How do I redirect the output to a file?
Hi I have multiple compressed files that I need to run grep against.
I am trying to find 'foo', 'bar' and '192.168.1.100' against all the compressed log files.
ls 201612*.gz | parallel zgrep foo {} | grep bar | grep 192.168.1.100
Thanks for such an awsome tool!
--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
|