Skip to content

Fix some errors #4

@Haroenv

Description

@Haroenv
$ shellcheck myscript

Line 11:
while [[ true ]]; do
         ^-- SC2160: Instead of '[ true ]', just use 'true'.

Line 15:
        read inputmethod
        ^-- SC2162: read without -r will mangle backslashes.

Line 16:
        if [[ $inputmethod == "/001" || $inpumethod == "ITEM001" ]]; then
                                        ^-- SC2154: inpumethod is referenced but not assigned (did you mean 'inputmethod'?).

Line 21:
                        read $2
                        ^-- SC2162: read without -r will mangle backslashes.
                             ^-- SC2086: Double quote to prevent globbing and word splitting.

Line 30:
                        read -s myresult
                        ^-- SC2162: read without -r will mangle backslashes.

Line 31:
                        myresult=$(sed 's/\//ITEM/;s/-/POS/;s/*/OPS/;s/+/HELP/' <<< $myresult)
                                                                                    ^-- SC2086: Double quote to prevent globbing and word splitting.

Line 32:
                        echo $myresult
                             ^-- SC2086: Double quote to prevent globbing and word splitting.

Line 33:
                        eval $__resultvar="'$myresult'"
                             ^-- SC2086: Double quote to prevent globbing and word splitting.

Line 40:
while [[ true ]]; do
         ^-- SC2160: Instead of '[ true ]', just use 'true'.

Line 43:
        case $lang in
             ^-- SC2154: lang is referenced but not assigned.

Line 105:
                case $position in
                     ^-- SC2154: position is referenced but not assigned.

Line 148:
                printf "\r%02d" $seconds
                                ^-- SC2086: Double quote to prevent globbing and word splitting.

Line 149:
                seconds=$(($seconds - 1))
                           ^-- SC2004: $/${} is unnecessary on arithmetic variables.

Line 157:
        case $operation in
             ^-- SC2154: operation is referenced but not assigned.

Line 168:
                                case $item in
                                     ^-- SC2154: item is referenced but not assigned.

Line 624:
                                                        dist=$(($dist - 80))
                                                                ^-- SC2004: $/${} is unnecessary on arithmetic variables.

Line 742:
                                min=$(($min+1))
                                       ^-- SC2004: $/${} is unnecessary on arithmetic variables.

Line 743:
                                max=$(($max-1))
                                       ^-- SC2004: $/${} is unnecessary on arithmetic variables.

Line 864:
while [[ true ]]; do
         ^-- SC2160: Instead of '[ true ]', just use 'true'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions