|
Process substitution sets up a FIFO and expands to the device file that fifo is associated with (/dev/fd/42 or somesuch). As such, all data from the command is redirected, doesn't matter what's in it.
The command substitution and here-string breaks because bash first does the command substitution, which chomps newlines from the end and cuts everything past a null in the data, since nulls aren't allowed in a string. Then, the here-string actually creates a here-document which actually creates a temporary file containing the string plus one newline at the end (since we chomped all of them earlier, but a valid text file must end each line with a newline).
Short story, the only way command substitution and here-string is equivalent to process substitution is when the content has exactly one newline at the end and no nulls whatsoever.
Last edited by tuxdev; 03-15-2010 at 01:50 AM.
|