[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PIPI (Parsed Input Process Initiator) -- another silly proposal?



>>>>> "Karl" == Karl Hammar <karl@kalle.csb.ki.se> writes:

    Karl>    Process Substitution Process substitution is supported on
    Karl> systems that support named pipes (FIFOs) or the /dev/fd
    Karl> method of naming open files.  It takes the form of <(list)
    Karl> or >(list).  The pro­ cess list is run with its input or
    Karl> output connected to a FIFO or some file in /dev/fd.  The
    Karl> name of this file is passed as an argument to the current
    Karl> command as the result of the expansion.  If the >(list) form
    Karl> is used, writing to the file will provide input for list.
    Karl> If the <(list) form is used, the file passed as an argument
    Karl> should be read to obtain the output of list.

This sounds similar to what zsh has had for ages (I think for longer
then bash, but I might be wrong).

However, out of curiosity (not trying to start a "my shell is better
then your shell" type debate, as everyone already knows the truth)
does bash have =(list)?

       If  = is used, then the file passed as an argument will be
       the name of a temporary file containing the output of  the
       list  process.  This may be used instead of the < form for
       a program that expects to  lseek  (see  lseek(2))  on  the
       input file.

I find this useful for commands like:

xdvi =(gunzip < /usr/share/texmf/doc/latex/seminar/sem-user.dvi.gz)
-- 
Brian May <bam@debian.org>



Reply to: