In /usr/bin/imagej line 32:
    JAVA_HOME=`/usr/sbin/update-java-alternatives -l | grep openjdk | grep $(dpkg --print-architecture) | sort -u -k2 | tail -1 | tr -s ' ' | cut -d' ' -f 3`
              ^-- SC2006: Use $(...) notation instead of legacy backticked `...`.
                                                                           ^--------------------------^ SC2046: Quote this to prevent word splitting.

Did you mean: 
    JAVA_HOME=$(/usr/sbin/update-java-alternatives -l | grep openjdk | grep $(dpkg --print-architecture) | sort -u -k2 | tail -1 | tr -s ' ' | cut -d' ' -f 3)


In /usr/bin/imagej line 74:
dir=`pwd`
^-^ SC2034: dir appears unused. Verify use (or export if used externally).
    ^---^ SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
dir=$(pwd)


In /usr/bin/imagej line 75:
user=`whoami`
     ^------^ SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
user=$(whoami)


In /usr/bin/imagej line 76:
host=`hostname`
     ^--------^ SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
host=$(hostname)


In /usr/bin/imagej line 95:
if [[ `uname` == 'SunOS' ]] ; then
      ^-----^ SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
if [[ $(uname) == 'SunOS' ]] ; then


In /usr/bin/imagej line 97:
    max_mem=`vmstat | awk 'NR == 3 {fmem=int($5 / 1024); if (fmem < 4000) {print fmem} else {print 4000}}'`
            ^-- SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
    max_mem=$(vmstat | awk 'NR == 3 {fmem=int($5 / 1024); if (fmem < 4000) {print fmem} else {print 4000}}')


In /usr/bin/imagej line 99:
    mem=${free_mem}/2*3
        ^-------------^ SC2125: Brace expansions and globs are literal in assignments. Quote it or use an array.


In /usr/bin/imagej line 100:
    if (( $mem > $default_mem || $mem < $min_mem )) ; then mem=$default_mem ; fi
          ^--^ SC2004: $/${} is unnecessary on arithmetic variables.
                 ^----------^ SC2004: $/${} is unnecessary on arithmetic variables.
                                 ^--^ SC2004: $/${} is unnecessary on arithmetic variables.
                                        ^------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 101:
elif [[ `uname` == 'Linux' ]] ; then
        ^-----^ SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
elif [[ $(uname) == 'Linux' ]] ; then


In /usr/bin/imagej line 102:
    if [[ `uname -m` == 'x86_64' ]] ; then
          ^--------^ SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
    if [[ $(uname -m) == 'x86_64' ]] ; then


In /usr/bin/imagej line 104:
        max_mem=`free | awk 'NR == 2 {fmem=int($2 / 1024); if (fmem < 4000) {print fmem} else {print 4000}}'`
                ^-- SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
        max_mem=$(free | awk 'NR == 2 {fmem=int($2 / 1024); if (fmem < 4000) {print fmem} else {print 4000}}')


In /usr/bin/imagej line 105:
        free_mem=`free | awk 'NR == 3 {fmem=int($4 / 1024); if (fmem < 4000) {print fmem} else {print 4000}}'`
                 ^-- SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
        free_mem=$(free | awk 'NR == 3 {fmem=int($4 / 1024); if (fmem < 4000) {print fmem} else {print 4000}}')


In /usr/bin/imagej line 106:
        mem=${free_mem}/3*2
            ^-------------^ SC2125: Brace expansions and globs are literal in assignments. Quote it or use an array.


In /usr/bin/imagej line 107:
        if (( $mem > $default_mem || $mem < $min_mem )) ; then mem=$default_mem ; fi
              ^--^ SC2004: $/${} is unnecessary on arithmetic variables.
                     ^----------^ SC2004: $/${} is unnecessary on arithmetic variables.
                                     ^--^ SC2004: $/${} is unnecessary on arithmetic variables.
                                            ^------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 109:
        java_path="${ij_path}/jre/bin/java"
        ^-------^ SC2034: java_path appears unused. Verify use (or export if used externally).


In /usr/bin/imagej line 110:
        max_mem=`free | awk 'NR == 2 {fmem=int($2 / 1024); if (fmem < 1800) {print fmem} else {print 1800}}'`
                ^-- SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
        max_mem=$(free | awk 'NR == 2 {fmem=int($2 / 1024); if (fmem < 1800) {print fmem} else {print 1800}}')


In /usr/bin/imagej line 111:
        free_mem=`free | awk 'NR == 3 {fmem=int($4 / 1024); if (fmem < 1800) {print fmem} else {print 1800}}'`
                 ^-- SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
        free_mem=$(free | awk 'NR == 3 {fmem=int($4 / 1024); if (fmem < 1800) {print fmem} else {print 1800}}')


In /usr/bin/imagej line 112:
        mem=${free_mem}/3*2
            ^-------------^ SC2125: Brace expansions and globs are literal in assignments. Quote it or use an array.


In /usr/bin/imagej line 113:
        if (( $mem > $default_mem || $mem < $min_mem )) ; then mem=$default_mem ; fi
              ^--^ SC2004: $/${} is unnecessary on arithmetic variables.
                     ^----------^ SC2004: $/${} is unnecessary on arithmetic variables.
                                     ^--^ SC2004: $/${} is unnecessary on arithmetic variables.
                                            ^------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 137:
mkdir -p $ij_user_path/plugins
         ^-----------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
mkdir -p "$ij_user_path"/plugins


In /usr/bin/imagej line 138:
mkdir -p $ij_user_path/macros
         ^-----------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
mkdir -p "$ij_user_path"/macros


In /usr/bin/imagej line 139:
mkdir -p $ij_user_path/luts
         ^-----------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
mkdir -p "$ij_user_path"/luts


In /usr/bin/imagej line 150:
    ls "$ij_system_subdir" | while read p ; do
    ^--------------------^ SC2012: Use find instead of ls to better handle non-alphanumeric filenames.
                                   ^--^ SC2162: read without -r will mangle backslashes.


In /usr/bin/imagej line 241:
        i) images="${images}'${OPTARG}' "
                            ^-- SC2089: Quotes/backslashes will be treated literally. Use an array.


In /usr/bin/imagej line 259:
        v) verbosity=verbosity+1
                     ^---------^ SC2100: Use $((..)) for arithmetics, e.g. i=$((i + 2))


In /usr/bin/imagej line 260:
           if (( $verbosity == 2 )) ; then set -x ; fi
                 ^--------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 261:
           if (( $verbosity == 3 )) ; then set -v ; fi
                 ^--------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 264:
           if (( $mem < $min_mem || $mem > $max_mem )) ; then
                 ^--^ SC2004: $/${} is unnecessary on arithmetic variables.
                        ^------^ SC2004: $/${} is unnecessary on arithmetic variables.
                                    ^--^ SC2004: $/${} is unnecessary on arithmetic variables.
                                           ^------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 277:
while (( i < $OPTIND )) ; do
             ^-----^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 279:
    i=i+1
      ^-^ SC2100: Use $((..)) for arithmetics, e.g. i=$((i + 2))


In /usr/bin/imagej line 298:
    macroargs="'$macroargs'"
               ^-- SC2089: Quotes/backslashes will be treated literally. Use an array.


In /usr/bin/imagej line 312:
pushd "$ij_tmp" > /dev/null
^-------------------------^ SC2164: Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.

Did you mean: 
pushd "$ij_tmp" > /dev/null || exit


In /usr/bin/imagej line 316:
declare -a locklist=(`ls | grep '[0-9][0-9]-.*'`)
                     ^-------------------------^ SC2207: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
                     ^-------------------------^ SC2006: Use $(...) notation instead of legacy backticked `...`.
                      ^-- SC2010: Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames.

Did you mean: 
declare -a locklist=($(ls | grep '[0-9][0-9]-.*'))


In /usr/bin/imagej line 318:
if (( $verbosity > 0 )) ; then echo -e "locklist: \n ${locklist[*]}" ; fi
      ^--------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 321:
if (( $port > 0 )) ; then
      ^---^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 324:
        prefix=`printf '%02u' $port`
               ^-------------------^ SC2006: Use $(...) notation instead of legacy backticked `...`.
                              ^---^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
        prefix=$(printf '%02u' "$port")


In /usr/bin/imagej line 328:
            if (( $verbosity > 0 )) ; then echo "Using socket lock: $lockname" ; fi
                  ^--------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 331:
        elif ("$lockname" =~ ${prefix}-* ) ; then
             ^---------------------------^ SC2205: (..) is a subshell. Did you mean [ .. ], a test expression?
                             ^-------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
        elif ("$lockname" =~ "${prefix}"-* ) ; then


In /usr/bin/imagej line 333:
            if (( $verbosity > 0 )) ; then echo "Port lock: $lockname" ; fi
                  ^--------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 346:
            if (( $verbosity > 0 )) ; then echo "Found socket lock: $lockname" ; fi
                  ^--------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 369:
                count=count+1
                      ^-----^ SC2100: Use $((..)) for arithmetics, e.g. i=$((i + 2))


In /usr/bin/imagej line 370:
                prefix=`printf '%02u' $count`
                       ^--------------------^ SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
                prefix=$(printf '%02u' $count)


In /usr/bin/imagej line 381:
    prefix=`printf '%02u' $count`
           ^--------------------^ SC2006: Use $(...) notation instead of legacy backticked `...`.

Did you mean: 
    prefix=$(printf '%02u' $count)


In /usr/bin/imagej line 383:
    if (( $verbosity > 0 )) ; then echo -n "creating lock $lockname ... " ; fi
          ^--------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 384:
    touch $lockname
          ^-------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
    touch "$lockname"


In /usr/bin/imagej line 390:
    if (( $verbosity > 0 )) ; then  echo 'done' ; fi
          ^--------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 392:
    lockFileCreated='true'
    ^-------------^ SC2034: lockFileCreated appears unused. Verify use (or export if used externally).


In /usr/bin/imagej line 395:
    if (( $verbosity > 0 )) ; then echo "Socket lock: $lockname" ; fi
          ^--------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 409:
popd > /dev/null
^--------------^ SC2164: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.

Did you mean: 
popd > /dev/null || exit


In /usr/bin/imagej line 416:
    if (( $verbosity > 0 )) ; then
          ^--------^ SC2004: $/${} is unnecessary on arithmetic variables.


In /usr/bin/imagej line 417:
        echo ${modules}
             ^--------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
        echo "${modules}"


In /usr/bin/imagej line 418:
        echo $JAVA_HOME/bin/java -mx${mem}m ${jni} ${modules} ij.ImageJ -ijpath ${ij_user_path} -port${count} ${images} ${macrocmd} ${macroargs}
             ^--------^ SC2086: Double quote to prevent globbing and word splitting.
                                    ^----^ SC2086: Double quote to prevent globbing and word splitting.
                                            ^----^ SC2086: Double quote to prevent globbing and word splitting.
                                                   ^--------^ SC2086: Double quote to prevent globbing and word splitting.
                                                                                ^-------------^ SC2086: Double quote to prevent globbing and word splitting.
                                                                                                              ^-------^ SC2090: Quotes/backslashes in this variable will not be respected.
                                                                                                              ^-------^ SC2086: Double quote to prevent globbing and word splitting.
                                                                                                                                    ^----------^ SC2090: Quotes/backslashes in this variable will not be respected.
                                                                                                                                    ^----------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
        echo "$JAVA_HOME"/bin/java -mx"${mem}"m "${jni}" "${modules}" ij.ImageJ -ijpath "${ij_user_path}" -port${count} "${images}" ${macrocmd} "${macroargs}"


In /usr/bin/imagej line 420:
        eval $JAVA_HOME/bin/java -mx${mem}m ${jni} ${modules} ij.ImageJ -ijpath ${ij_user_path} -port${count} ${images} ${macrocmd} ${macroargs}
             ^--------^ SC2086: Double quote to prevent globbing and word splitting.
                                    ^----^ SC2086: Double quote to prevent globbing and word splitting.
                                            ^----^ SC2086: Double quote to prevent globbing and word splitting.
                                                   ^--------^ SC2086: Double quote to prevent globbing and word splitting.
                                                                                ^-------------^ SC2086: Double quote to prevent globbing and word splitting.
                                                                                                              ^-------^ SC2086: Double quote to prevent globbing and word splitting.
                                                                                                                                    ^----------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
        eval "$JAVA_HOME"/bin/java -mx"${mem}"m "${jni}" "${modules}" ij.ImageJ -ijpath "${ij_user_path}" -port${count} "${images}" ${macrocmd} "${macroargs}"

For more information:
  https://www.shellcheck.net/wiki/SC2010 -- Don't use ls | grep. Use a glob o...
  https://www.shellcheck.net/wiki/SC2034 -- dir appears unused. Verify use (o...
  https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt...