On 5/29/20 11:59 AM, ladyrick wrote: > Bash Version: 4.4 > Patch Level: 12 > Release Status: release > > > Description: > A heredoc starts with "cat <<'EOF'" is expected to not expand anything > just like in a single quote string. But when this heredoc is in a $() or <(), > history is expanded.
It's an interesting question. While quoted here-document delimiters do suppress expansion, unquoted delimiters result in expansion similar to double quotes, and double quotes don't suppress history substitution. Yet, when not in a command substitution, history substitution is never performed on the lines in a here-document. But consistency is important, and I agree that the expansion should not take place while parsing command or process substitutions, whether or not the delimiter is quoted. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/