Como esta construção de entrada dupla do shell funciona?

1

Aqui Encontrei uma construção de entrada de shell que nunca vi antes, mas que funciona. Ele lê

comm <(fancy input mangling) <(another input construction)

Como isso funciona em um programa normal stdin / stdout / stderr, como o programa faz distinção entre o primeiro e o segundo arquivo de entrada?

    
por JdeHaan 30.11.2016 / 10:36

1 resposta

2

man e grep são seus amigos.

$ man bash | grep -C2 '<('
   Process Substitution
       Process  substitution  is  supported  on systems that support named pipes (FIFOs) or the /dev/fd method of naming open files.  It
       takes the form of <(list) or >(list).  The process list is run with its input or output connected to  a  FIFO  or  some  file  in
       /dev/fd.   The  name of this file 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.
    
por 30.11.2016 / 14:44

Tags