[erlang-patches] Make newline in RHS of lib/configure sed substition more portable

Björn Gustavsson bgustavsson@REDACTED
Tue Feb 9 07:39:33 CET 2010


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.

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?

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB


More information about the erlang-patches mailing list