[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231227164645.765f7891@hermes.local>
Date: Wed, 27 Dec 2023 16:46:45 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Eli Schwartz <eschwartz93@...il.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH iproute2 2/2] configure: use the portable printf to
suppress newlines in messages
On Sun, 17 Dec 2023 22:30:53 -0500
Eli Schwartz <eschwartz93@...il.com> 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
> https://cfajohnson.com/shell/cus-faq.html#Q0b
> ---
This is needless churn, it works now, and bash is never going
to remove the echo command. The script only has to work on Linux.
Plus, the patch is missing signed-off-by.
Powered by blists - more mailing lists