Re: Backslash handling not POSIX-compliant

2020-07-29 Thread Edward Welbourne
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

Re: Backslash handling not POSIX-compliant

2020-07-28 Thread Ivan Kozlov
My test case is actually wrong. The standard output would be the same in both cases. Here is a proper test case: >.POSIX: >test: > A=\\ > echo $$A The expected result is >\ being written to the standard output. The actual result is an empty line being written. Another example is: >.POSIX:

Re: Backslash handling not POSIX-compliant

2020-07-28 Thread Paul Smith
On Tue, 2020-07-28 at 08:07 +0300, Ivan Kozlov wrote: > Doubling the backslash suppresses special newline handling in GNU > make. I don’t see anything in the standard that allows this. It > defines an escaped newline as one preceded by a backslash and doesn’t > say anything about backslashes being

Backslash handling not POSIX-compliant

2020-07-28 Thread Ivan Kozlov
Doubling the backslash suppresses special newline handling in GNU make. I don’t see anything in the standard that allows this. It defines an escaped newline as one preceded by a backslash and doesn’t say anything about backslashes being treated specially otherwise. Test case: >.POSIX: >test: >