public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: rebecca@bsdio.com
To: devel@edk2.groups.io, leif.lindholm@linaro.org
Cc: lersek@redhat.com, bob.c.feng@intel.com, liming.gao@intel.com,
	michael.d.kinney@intel.com, afish@apple.com
Subject: Re: [edk2-devel] [PATCH 1/1] edksetup.sh: rework python executable scanning
Date: Tue, 16 Jul 2019 14:10:43 -0600	[thread overview]
Message-ID: <08f3b643-0622-7db4-ad28-e1145f053384@bsdio.com> (raw)
In-Reply-To: <20190716190754.25412-1-leif.lindholm@linaro.org>

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

On 2019-07-16 13:07, Leif Lindholm wrote:
> +        EXECUTABLE=`basename $file`
> +        VERSION=`echo $EXECUTABLE | sed 's/[^0-9.]//g'`
> +
> +        MAJOR=`echo $VERSION | sed 's/\([0-9]*\)\.*.*/\1/'`
> +        MINOR=`echo $VERSION | sed 's/[0-9]*\.*\([0-9]*\).*/\1/'`
> +        PATCH=`echo $VERSION | sed 's/[0-9]*\.*[0-9]*\.*\([0-9]*\)/\1/'`

Here and in other places, we should probably use $(...) instead of `...` .


>From http://mywiki.wooledge.org/BashFAQ/082 :

" `...` is the legacy syntax required by only the very oldest of
non-POSIX-compatible bourne-shells. There are several reasons to always
prefer the $(...) syntax..."


And https://wiki.bash-hackers.org/scripting/obsolete

"Both the |`COMMANDS`| and |$(COMMANDS)| syntaxes are specified by
POSIX, but the latter is _greatly_ preferred, though the former is
unfortunately still very prevalent in scripts."


-- 

Rebecca Cran


[-- Attachment #2: Type: text/html, Size: 1717 bytes --]

  reply	other threads:[~2019-07-16 20:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-16 19:07 [PATCH 1/1] edksetup.sh: rework python executable scanning Leif Lindholm
2019-07-16 20:10 ` rebecca [this message]
2019-07-17 14:04   ` [edk2-devel] " Leif Lindholm
2019-07-16 20:49 ` Laszlo Ersek
2019-07-16 22:04   ` Leif Lindholm
2019-07-17  3:23     ` Liming Gao
2019-07-17 10:21       ` Laszlo Ersek
2019-07-17 14:32         ` Liming Gao
2019-07-17 19:43           ` Laszlo Ersek
2019-07-17 22:37       ` Leif Lindholm
2019-07-18 16:48         ` [edk2-devel] " Liming Gao
2019-07-18 17:55           ` Leif Lindholm
2019-07-19 13:07             ` Liming Gao
2019-07-23  9:44               ` Leif Lindholm
2019-07-24 15:29                 ` Liming Gao
2019-07-17 10:13     ` Laszlo Ersek

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-list 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=08f3b643-0622-7db4-ad28-e1145f053384@bsdio.com \
    --to=devel@edk2.groups.io \
    /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