[erlang-patches] Make newline in RHS of lib/configure sed substition more portable
Tuncer Ayaz
tuncer.ayaz@REDACTED
Tue Feb 9 14:04:29 CET 2010
2010/2/9 Björn Gustavsson <bgustavsson@REDACTED>:
> On Tue, Feb 9, 2010 at 12:51 AM, Tuncer Ayaz <tuncer.ayaz@REDACTED> wrote:
>> The escaped newline character in the substitution string
>> does not work as expected.
>> On a Linux machine it inserts an additional blank line
>> and on OSX it only inserts a leading 'n' which gives you
>> a broken lib/configure script.
>>
>> I've successfully tested the fix on Linux and OSX.
>>
>> git fetch git://github.com/tuncer/otp.git otp_build_sed_newline
>
> Thanks for noticing this. I have amended the commit message to include
> the commit ID of the commit that introduced the non-portable NL.
Thanks, commit message adjusted in tuncer/erlang@REDACTED
> I am not an expert on shell script portability, but I noted that you use
> a backslash in your definition of the NL variable:
>
> NL="\
> "
>
> while all shell scripts in the Git project (source code and test suites),
> don't use a backslash and single quotes:
>
> LF='
> '
>
> Is is just matter of taste or is the variant used in Git (even) more portable?
Without the BSL sed complains about the RHS:
"unescaped newline inside substitute pattern"
When I use single quotes on both Linux and OSX it works but
inserts an additional blank line after the break.
More information about the erlang-patches
mailing list