Skip to main content
1 of 5
Kusalananda
  • 356.1k
  • 42
  • 737
  • 1.1k

A process substitution (<(...)) is not at all the same as a command substitution ($(...)).

A command substitution will be replaced by the output of the command, while a process substitution will be replaced by a filename from which the output of the command may be read.

In your case, the output from pwd in <(pwd) may be found at /dev/fd/63. This file ceases to exist as soon as the command that uses the command substitution has finished executing (when the echo in your example is done).

A common use of process substitution is to pre-sort files for the join command:

$ join <( sort file1 ) <( sort file2 ) 

or for removing columns from a file (here, column 2 is removed):

$ paste <( cut -f 1 file ) <( cut -f 3- file ) 
Kusalananda
  • 356.1k
  • 42
  • 737
  • 1.1k