Setting up pipelines reading from named pipes without blocking in bash

前端 未结 2 1997
别跟我提以往
别跟我提以往 2020-12-18 02:17

I\'m looking to call a subprocess with a file descriptor opened to a given pipe such that the open() call does not hang waiting for the other side of the pipe to receive a c

2条回答
  •  醉酒成梦
    2020-12-18 02:56

    The only way I know getting this kind of result is a hack:

    mkfifo /tmp/foobar.in
    mkfifo /tmp/foobar.out
    ( cat /tmp/foobar.out &
    some_program --command-fd=5 5

    perhaps this helps :-)

提交回复
热议问题