﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
18756	Fix shellcheck warnings of shellscripts	simon04	simon04	"https://www.shellcheck.net/ – ShellCheck, a static analysis tool for shell scripts

{{{
$ shellcheck linux/tested/usr/bin/josm 

In linux/tested/usr/bin/josm line 7:
ALTERNATIVE_JDK=""`readlink -n -f /etc/alternatives/java`""
                 ^-- SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
ALTERNATIVE_JDK=""$(readlink -n -f /etc/alternatives/java)""


In linux/tested/usr/bin/josm line 10:
ARCH=""`dpkg --print-architecture 2> /dev/null || true`""
      ^-- SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
ARCH=""$(dpkg --print-architecture 2> /dev/null || true)""


In linux/tested/usr/bin/josm line 16:
|| dpkg --get-selections 'openjdk-*-jre:$ARCH' | grep install$ > /dev/null ; then
                         ^-------------------^ SC2016: Expressions don't expand in single quotes, use double quotes for that.


In linux/tested/usr/bin/josm line 33:
    . /etc/default/josm
      ^---------------^ SC1091: Not following: /etc/default/josm was not specified as input (see shellcheck -x).


In linux/tested/usr/bin/josm line 40:
        if [ ""z$ALTERNATIVE_JDK"" = ""z`readlink -n -f $jcmd`"" ] && [ -z ""${JAVACMD}"" ]; then
                                     ^--------------------^ SC2006: Use $(...) notation instead of legacy backticked `...`.
                                                     ^---^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
        if [ ""z$ALTERNATIVE_JDK"" = ""z$(readlink -n -f ""$jcmd"")"" ] && [ -z ""${JAVACMD}"" ]; then


In linux/tested/usr/bin/josm line 49:
        if [ -x ""$jcmd"" -a -z ""${JAVACMD}"" ]; then
                        ^-- SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.


In linux/tested/usr/bin/josm line 58:
    if [ ""`expr match \""${JAVACMD}\"" 'java-9'`"" != ""0"" ] || [ ""`expr match \""${JAVACMD}\"" 'java-10'`"" != ""0"" ]; then
          ^-- SC2006: Use $(...) notation instead of legacy backticked `...`.
           ^--^ SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
                                                               ^-- SC2006: Use $(...) notation instead of legacy backticked `...`.
                                                                ^--^ SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].

Did you mean: 
    if [ ""$(expr match \""${JAVACMD}\"" 'java-9')"" != ""0"" ] || [ ""$(expr match \""${JAVACMD}\"" 'java-10')"" != ""0"" ]; then


In linux/tested/usr/bin/josm line 60:
    elif [ ""`expr match \""${JAVACMD}\"" 'java-1'`"" != ""0"" ]; then
            ^-- SC2006: Use $(...) notation instead of legacy backticked `...`.
             ^--^ SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].

Did you mean: 
    elif [ ""$(expr match \""${JAVACMD}\"" 'java-1')"" != ""0"" ]; then


In linux/tested/usr/bin/josm line 65:
        $JAVACMD $JAVA_OPTS -jar /usr/share/josm/josm.jar ""$@""
                 ^--------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
        $JAVACMD ""$JAVA_OPTS"" -jar /usr/share/josm/josm.jar ""$@""

For more information:
  https://www.shellcheck.net/wiki/SC2166 -- Prefer [ p ] && [ q ] as [ p -a q...
  https://www.shellcheck.net/wiki/SC1091 -- Not following: /etc/default/josm ...
  https://www.shellcheck.net/wiki/SC2016 -- Expressions don't expand in singl...
}}}"	defect	closed	normal	20.02	Core		fixed	bash shell	sebastic
