Hi Junio
On 27/05/2025 18:18, Junio C Hamano wrote:
Phillip Wood <phillip.wood123@xxxxxxxxx> writes:
Should that be " \$"? What you've got seems to work with dash but I'm
not sure if it is POSIX compliant or not.
"2.6 Word Expansions" ends with this sentence:
If a '$' that is neither within single-quotes nor escaped by a
<backslash> is immediately followed by a <space>, <tab>, or a
<newline>, or is not followed by any character, the '$' shall be
treated as a literal character.
Taken together with "2.2.3 Double-Quotes", I'd read it as blessing a
lone '$' at the end of double-quoted string as a literal dollar sign.
Thanks for finding that - TIL. I agree with your interpretation that the
original is in fact safe.
Thanks
Phillip