Ivan Kozlov (28 July 2020 16:18) wrote > The expected behaviour is useful because it allows portably quoting > macros with here-documents, for example: > > sed '$s:\\$::' <<\end; : \\ > > $V\ > > end > should print the literal value of the macro $V that can contain single > quotes and special characters. I believe there is no other way to > achieve this with POSIX make.
Putting quotes round the here-tag has the same effect as escaping it: $ V=argle $ cat <<EOF > some text $V > EOF some text argle $ cat <<"EOF" > some text $V > EOF some text $V $ cat <<'EOF' > some text $V > EOF some text $V $ cat <<\EOF > some text $V > EOF some text $V I find this works in both dash and bash. Not sure how that maps out for the use within make, though. Eddy.