Skip to content
koalaman edited this page Sep 5, 2015 · 1 revision

Ignoring errors

To ignore a shellcheck error, you can do one of three things:

Ignoring one specific instance in a file

Use a directive to disable a certain instance:

hexToAscii() {
  # shellcheck disable=SC2059
  printf "\x$1"
}

Ignoring errors in one specific run

Use a -e flag to disable a specific error when running shellcheck:

$ shellcheck -e SC2059 myscript

Ignoring one type of error forever

Set the SHELLCHECK_OPTS variable in your .bashrc, /etc/profile or equivalent:

export SHELLCHECK_OPTS="-e SC2059"
Clone this wiki locally