What is the correct way to redirect the output of multiple commands as input for another command?
$ command < (command2 | grep pattern)
(This refers to bash in case of doubt)
The output of one command or one pipeline can be made the input of another command by creating a (or extending the existing) pipeline:
Several commands (including pipelines) can be combined with a subshell or a list (group command). This combination becomes the first part of the pipeline then:
Another possibility is a "here string" (or even a "here document"):
Command substitution is used when the output shall be part of a command line i.e. if one command shall see the output of another as its own parameter:
echo sees the output of
Process substitution makes the output of another process appearing as the content of a (non-seekable) file given as parameter on the command line.
looks to grep like
You have to execute the commands using the command substitution syntax.