Add a big buffer to a pipe between two commands

后端 未结 5 1855
灰色年华
灰色年华 2020-12-29 03:14

Given a bash command line of the form

commandA | commandB

I want to add a buffer of size ~1MB that sits between commandA and <

5条回答
  •  有刺的猬
    2020-12-29 03:57

    alternatively you could use a named pipe and run them in parallel:

    mkfifo myfifo
    commandB < myfifo &
    commandA > myfifo
    rm myfifo
    

提交回复
热议问题