public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [PATCH] contrib: Avoid use of "echo -n" in git customization [PR102664]
Date: Wed, 9 Mar 2022 12:15:21 +0000	[thread overview]
Message-ID: <fea9431c-e183-53a8-c883-1bfb31ecf1d2@foss.arm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 217 bytes --]

The -n option to echo is non-portable.  The generally recommended
alternative is to use the shell printf command.

contrib/ChangeLog:

	PR other/102664
	* gcc-git-customization.sh (ask): Use printf instead of echo -n.

[-- Attachment #2: echo-no-n.patch --]
[-- Type: text/x-patch, Size: 405 bytes --]

diff --git a/contrib/gcc-git-customization.sh b/contrib/gcc-git-customization.sh
index b24948d9874..cf46c494a6a 100755
--- a/contrib/gcc-git-customization.sh
+++ b/contrib/gcc-git-customization.sh
@@ -7,7 +7,7 @@ ask () {
     question=$1
     default=$2
     var=$3
-    echo -n $question "["$default"]? "
+    printf "%s" "$question [$default]? "
     read answer
     if [ "x$answer" = "x" ]
     then

             reply	other threads:[~2022-03-09 12:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09 12:15 Richard Earnshaw [this message]
2022-03-09 15:05 ` Jonathan Wakely
2022-03-10 11:43   ` Richard Earnshaw

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=fea9431c-e183-53a8-c883-1bfb31ecf1d2@foss.arm.com \
    --to=richard.earnshaw@foss.arm.com \
    --cc=gcc-patches@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).