How to make a pipe loop in bash

前端 未结 7 1559
半阙折子戏
半阙折子戏 2020-12-05 03:25

Assume that I have programs P0, P1, ...P(n-1) for some n > 0. How can I easily redirect the output of program Pi

7条回答
  •  误落风尘
    2020-12-05 03:47

    Named pipes.

    Create a series of fifos, using mkfifo

    i.e fifo0, fifo1

    Then attach each process in term to the pipes you want:

    processn < fifo(n-1) > fifon

提交回复
热议问题