Isso é chamado de substituição de processo.
3.5.6 Substituição de processos
Process substitution allows a process’s input or output to be referred to using a filename.
The process list is run asynchronously, and its input or output appears as a filename. This filename is passed as an argument to the current command as the result of the expansion. If the >(list) form is used, writing to the file will provide input for list. If the <(list) form is used, the file passed as an argument should be read to obtain the output of list. Note that no space may appear between the < or > and the left parenthesis, otherwise the construct would be interpreted as a redirection. Process substitution is supported on systems that support named pipes (FIFOs) or the /dev/fd method of naming open files.
Não é apenas uma coisa básica como originalmente apareceu no ksh, mas não está no padrão posix.
Under the hood, process substitution has two implementations. On systems which support
/dev/fd
(most Unix-like systems) it works by calling thepipe(
) system call, which returns a file descriptor$fd
for a new anonymous pipe, then creating the string/dev/fd/$fd
, and substitutes that on the command line. On systems without/dev/fd
support, it callsmkfifo
with a new temporary filename to create a named pipe, and substitutes this filename on the command line.