Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Fix shellcheck warnings in the scripts #118

@eero-t

Description

@eero-t

Pre-condition:

  • sudo apt install shellcheck or dnf install shellcheck

There are quite a few shell scripts:

find -name '*.*sh' | wc -l
38

And they trigger a lot of shellcheck warnings:

find -name '*.*sh' | xargs shellcheck | grep SC[0-9]*: | wc -l
658

Note: one should not follow shellcheck recommendations blindly. Main one where one could screw up is changing this:

base_opts="-a -b -c"
command $base_opts -d -e -f

To:

base_opts="-a -b -c"
command "$base_opts" -d -e -f

My preferred way is just adding shellcheck override for them, or switching to helper function like this:

run_command () {
   command -a -b -c $*
}
run_command -d -e -f

Whichever makes more sense for given code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions