Subject: Re: bug#6900: mktemp: want option to make a fifo

From: John Reiser <[email-masked]>
Date: Tue, 24 Aug 2010 10:42:08 -0700

> The two requests would have been more convincing if they demonstrated
> a definite need.

Another case: "pipe" stderr into a separate pipeline from stdout.
This is useful for stderr as a status channel.

    fifo_stderr1=$(mktemp --fifo stderr.XXXXXX)
    fifo_stderr2=$(mktemp --fifo stderr.XXXXXX)
    listener1 < $fifo_stderr1 &
    listener2 < $fifo_stderr2 &
    cmd1  2> $fifo_stderr1  |  cmd2  2> $fifo_stderr2

Another case: Use file descriptor 3 as a command and control channel.
Output has two default file descriptors (stdout and stderr), why not
input (stdin and cmdin)?  This is especially helpful for repairing a
nest of processes that are connected by pipes.

   fifo_cmdin1=$(mktemp --fifo cmdin.XXXXXX); sleep 999000 > $fifo_cmdin1 &
   fifo_cmdin2=$(mktemp --fifo cmdin.XXXXXX); sleep 999000 > $fifo_cmdin2 &
   cmd1  3< $fifo_cmdin1  |  cmd2  3< $fifo_cmdin2  &
   echo quit  > $fifo_cmdin1

--