netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Eli Schwartz <eschwartz93@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2 2/2] configure: use the portable printf to suppress newlines in messages
Date: Wed, 27 Dec 2023 16:46:45 -0800	[thread overview]
Message-ID: <20231227164645.765f7891@hermes.local> (raw)
In-Reply-To: <20231218033056.629260-2-eschwartz93@gmail.com>

On Sun, 17 Dec 2023 22:30:53 -0500
Eli Schwartz <eschwartz93@gmail.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.

  reply	other threads:[~2023-12-28  0:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18  3:30 [PATCH iproute2 1/2] configure: avoid un-recommended command substitution form Eli Schwartz
2023-12-18  3:30 ` [PATCH iproute2 2/2] configure: use the portable printf to suppress newlines in messages Eli Schwartz
2023-12-28  0:46   ` Stephen Hemminger [this message]
2023-12-28  3:53     ` Eli Schwartz
2023-12-29  6:00     ` [PATCH 1/2] configure: avoid un-recommended command substitution form Eli Schwartz
2023-12-29  6:00       ` [PATCH 2/2] configure: use the portable printf to suppress newlines in messages Eli Schwartz
2024-01-01 19:03         ` Stephen Hemminger
2023-12-28  0:46 ` [PATCH iproute2 1/2] configure: avoid un-recommended command substitution form Stephen Hemminger
2023-12-28  3:57   ` Eli Schwartz
2023-12-29 19:36     ` Stephen Hemminger
2023-12-30  0:42       ` David Ahern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231227164645.765f7891@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=eschwartz93@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).