shellcheck
shellcheck copied to clipboard
Doesn't recognize BASH_ARGV0
I'm assigning in a bash script the variable BASH_ARGV0, which is the way of modifying the value of $0. Unfortunately, checkshell doesn't recognize it and shows an SC2034 UNUSED VARIABLE. Tested online and with version 0.8.0.
Example code:
#!/bin/bash
# emulate "exec $@" with "source"
BASH_ARGV0=$1
shift
# shellcheck source=/dev/null
source "$0"
- [X] The rule's wiki page does not already cover this (e.g. https://shellcheck.net/wiki/SC2086)
- [X] I tried on https://www.shellcheck.net/ and verified that this is still a problem on the latest commit