This week I have published a Shebang wrapper that runs script if shellcheck returns no errors.

Check the documentation for detailed getting started and usage instructions, the source code is available on GitHub.

After installation, write a script that uses /usr/local/sbin/shellchecker as the shebang…

example.sh

#!/usr/local/sbin/shellchecker --format=gcc bash --restricted

_argument_list=("${@}")
for i in "${!_argument_list[@]}"; do
    printf '_argument_list[%i] -> %s\n' "${i}" "${_argument_list[${i}]}"
done

Provide executable permissions and run example.sh script…

chmod u+x ./example.sh


./example.sh