bashprocess-substitutionherestring

Combining process substitution with a here string


I am trying to combine the results of a command and a here string like this:

cat <(echo first) <<< second

I am getting this output:

first

Instead of

first
second

Why?


Solution

  • From man cat:

    With no FILE, or when FILE is -, read standard input.

    But with file different then -, standard input is not read.

    I guess you'll want:

    cat <(echo first) - <<<second