Hello,
I'm experimenting with data filtering use some of console programs and found weird behaviour with piping STDOUT of GNU grep to /dev/null.
File test is 10Gb of data (apache log).
It seems
But if I pipe output to
It outputs to file also without any problem:
The same problem with textproc/ugrep:
There is no such problem with for example BSD grep or GNU Awk:
My shell is
Does anyone have an idea of why such happen?
Thank you!
I'm experimenting with data filtering use some of console programs and found weird behaviour with piping STDOUT of GNU grep to /dev/null.
File test is 10Gb of data (apache log).
Code:
$ /usr/bin/time -h ggrep 'GET' test > /dev/null
0,00s real 0,00s user 0,00s sys
ggrep
output nothing as it's even didn't start data processing and exitted without any error out.But if I pipe output to
cat
and and then to /dev/null - everything works fine:
Code:
$ /usr/bin/time -h ggrep 'GET' test | cat > /dev/null
24,40s real 10,70s user 13,45s sys
Code:
$ /usr/bin/time -h ggrep 'GET' test > ~/test.output
22,80s real 10,97s user 11,37s sys
Code:
$ /usr/bin/time -h ugrep 'GET' test > /dev/null
0,00s real 0,00s user 0,00s sys
There is no such problem with for example BSD grep or GNU Awk:
Code:
$ /usr/bin/time -h gawk '/GET/' test > /dev/null
21,78s real 13,41s user 8,36s sys
My shell is
tcsh
but result is the same with sh
, bash
, csh
.Does anyone have an idea of why such happen?
Thank you!