bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: embedded newlines in shell function variable expansion


From: Paul Smith
Subject: Re: embedded newlines in shell function variable expansion
Date: Fri, 09 Oct 2020 12:15:05 -0400
User-agent: Evolution 3.36.4-0ubuntu1

On Fri, 2020-10-09 at 15:03 +0000, Byrnes, Robert wrote:
> Why is the embedded whitespace removed in the first (FOO) case?  It
> seems related to the semicolon shell metacharacter ...

My suspicion is that it's a difference between your /bin/echo command
and your shell's builtin echo command.

In the first case (with the ";") because there's a special character in
the command GNU make will run a shell like this:

   /bin/sh -c 'echo ... ; '

and the shell's built-in echo will be used (if it has one, which most
shells do).

In the second case (without the ";"), there's no special character and
so GNU make runs the fast path which invokes the echo command directly,
not using a shell, and so it will use your PATH to find an "echo"
program and run that.

If you change both commands to use /bin/echo explicitly, do they work
the same way?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]