Subject: Re: [PATCH 2/2] configure: use the portable printf to suppress newlines in messages

From: Stephen Hemminger <[email-masked]>
Date: Mon, 1 Jan 2024 11:03:48 -0800

On Fri, 29 Dec 2023 01:00:10 -0500
Eli Schwartz <[email-masked]> wrote:

> Per https://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html
> the "echo" utility is un-recommended and its behavior is non-portable
> and unpredictable. It *should* be marked as obsolescent, but was not,
> due solely "because of its extremely widespread use in historical
> applications".
> 
> POSIX doesn't require the -n option, and although its behavior is
> reliable in `#!/bin/bash` scripts, this configure script uses
> `#!/bin/sh` and cannot rely on echo -n.
> 
> The use of printf even without newline suppression or backslash
> character sequences is nicer for consistency, since there are a variety
> of ways it can go wrong with echo including "echoing the value of a
> shell or environment variable".
> 
> See: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html
> See: https://cfajohnson.com/shell/cus-faq.html#Q0b
> Signed-off-by: Eli Schwartz <[email-masked]>

This part is not necessary. Although echo is not portable, it is used
many places and not worth changing.