public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] gdb: fix shellcheck warnings SC2006 (use $() instead of ``) in gdbarch.sh
Date: Sat, 16 May 2020 05:04:50 -0400	[thread overview]
Message-ID: <cb02ab2416c2d83ca053652a21788189f3f7779f@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT cb02ab2416c2d83ca053652a21788189f3f7779f ***

commit cb02ab2416c2d83ca053652a21788189f3f7779f
Author:     Simon Marchi <simon.marchi@efficios.com>
AuthorDate: Wed Apr 29 20:35:34 2020 -0400
Commit:     Simon Marchi <simon.marchi@efficios.com>
CommitDate: Wed Apr 29 20:35:34 2020 -0400

    gdb: fix shellcheck warnings SC2006 (use $() instead of ``) in gdbarch.sh
    
    Fix all instances of:
    
        In gdbarch.sh line 2195:
                printf "            `echo "$function" | sed -e 's/./ /g'`  %s %s)\n" "$returntype" "$function"
                                    ^-- SC2006: Use $(...) notation instead of legacy backticked `...`.
    
        Did you mean:
                printf "            $(echo "$function" | sed -e 's/./ /g')  %s %s)\n" "$returntype" "$function"
    
    See here [1] for the rationale.
    
    [1] https://github.com/koalaman/shellcheck/wiki/SC2006
    
    gdb/ChangeLog:
    
            * gdbarch.sh: Use $(...) instead of `...`.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index eefeac4c18..d751c052ce 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2020-04-29  Simon Marchi  <simon.marchi@efficios.com>
+
+	* gdbarch.sh: Use $(...) instead of `...`.
+
 2020-04-29  Simon Marchi  <simon.marchi@efficios.com>
 
 	* gdbarch.sh: Use double quotes around variables.
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index a934a7aa6b..0e89bd1900 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -67,7 +67,7 @@ ${line}"
 	    # The semantics of IFS varies between different SH's.  Some
 	    # treat ``;;' as three fields while some treat it as just two.
 	    # Work around this by eliminating ``;;'' ....
-	    line="`echo "${line}" | sed -e 's/;;/; ;/g' -e 's/;;/; ;/g'`"
+	    line="$(echo "${line}" | sed -e 's/;;/; ;/g' -e 's/;;/; ;/g')"
 
 	    OFS="${IFS}" ; IFS="[;]"
 	    eval read "${read}" <<EOF
@@ -2162,7 +2162,7 @@ do
 	printf "\n"
 	printf "void\n"
 	printf "set_gdbarch_%s (struct gdbarch *gdbarch,\n" "$function"
-        printf "            `echo "$function" | sed -e 's/./ /g'`  gdbarch_%s_ftype %s)\n" "$function" "$function"
+	printf "            %s  gdbarch_%s_ftype %s)\n" "$(echo "$function" | sed -e 's/./ /g')" "$function" "$function"
 	printf "{\n"
 	printf "  gdbarch->%s = %s;\n" "$function" "$function"
 	printf "}\n"
@@ -2192,7 +2192,7 @@ do
 	printf "\n"
 	printf "void\n"
 	printf "set_gdbarch_%s (struct gdbarch *gdbarch,\n" "$function"
-        printf "            `echo "$function" | sed -e 's/./ /g'`  %s %s)\n" "$returntype" "$function"
+	printf "            %s  %s %s)\n" "$(echo "$function" | sed -e 's/./ /g')" "$returntype" "$function"
 	printf "{\n"
 	printf "  gdbarch->%s = %s;\n" "$function" "$function"
 	printf "}\n"


             reply	other threads:[~2020-05-16  9:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-16  9:04 gdb-buildbot [this message]
2020-05-16  9:04 ` Failures on Fedora-i686, branch master gdb-buildbot
2020-05-16  9:22 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2020-05-16 10:11 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-05-16 10:31 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-05-16 10:55 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-05-16 11:15 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-05-16 12:59 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2020-05-16 13:16 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot

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=cb02ab2416c2d83ca053652a21788189f3f7779f@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.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).