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