【问题标题】:Why is this pipe not terminated为什么这个管道没有终止
【发布时间】:2013-10-23 07:57:36
【问题描述】:

主题Why is this pipe terminated? 解释,为什么管道可能会被“头”过早关闭:

find / | head

那么为什么下面的管道没有被'head'关闭?

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

使用 grep 代替 zgrep 会产生很多

find: "grep" terminated by signal 13

警告,但管道仍然保持活动状态。有什么方法可以提前停止 'find' 和 'grep' 的组合?

【问题讨论】:

    标签: linux unix find pipe head


    【解决方案1】:

    发生这种情况是因为 find 产生了许多 grep 进程,但是由于它没有找到输出到管道,所以它没有得到信号

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-09
      • 1970-01-01
      • 2014-11-18
      相关资源
      最近更新 更多