To ignore a shellcheck error, you can do one of three things:
Use a directive to disable a certain instance:
hexToAscii() { # shellcheck disable=SC2059 printf "\x$1" }
Use a -e flag to disable a specific error when running shellcheck:
-e
$ shellcheck -e SC2059 myscript
Set the SHELLCHECK_OPTS variable in your .bashrc, /etc/profile or equivalent:
SHELLCHECK_OPTS
.bashrc
/etc/profile
export SHELLCHECK_OPTS="-e SC2059"
Add a directive at the top of the file:
#!/bin/sh # shellcheck disable=SC2059
Note that the directive must be on the first line after the shebang (#779). That will be fixed in 0.4.6+
There was an error while loading. Please reload this page.