[edk2-devel] [PATCH 1/1] edksetup.sh: rework python executable scanning
rebecca at bsdio.com
rebecca at bsdio.com
Tue Jul 16 20:10:43 UTC 2019
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
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#43817): https://edk2.groups.io/g/devel/message/43817
Mute This Topic: https://groups.io/mt/32495132/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20190716/895e80f1/attachment.htm>
More information about the edk2-devel-archive
mailing list