0

Topic Why is this pipe terminated? explains, why a pipe may prematurely be closed by 'head':

find / | head

So why is the following pipe not closed by 'head'?

find / -exec zgrep -l 'a' {} \; | head

using grep instead of zgrep produces lots of

find: "grep" terminated by signal 13

warnings, but the the pipe nevertheless stays active. Is there any way to prematurly stop 'find' in combination with 'grep'?

Rubén
  • 34,714
  • 9
  • 70
  • 166
Henning
  • 1,289
  • 2
  • 11
  • 25

1 Answers1

1

It happen because find is spawning many grep process, but since it's not find wich output to the pipe, it don't get the signal

izissise
  • 898
  • 1
  • 7
  • 23