-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2292
This is an optional suggestion. It must be explicitly enabled with a directive enable=require-double-brackets
in a # shellcheck
comment or .shellcheckrc
[ -e /etc/issue ]
[[ -e /etc/issue ]]
ShellCheck has been explicitly asked to warn about uses of [ .. ]
in favor of the extended Bash/Ksh test [[ .. ]]
.
[[ .. ]]
suppresses word splitting and globbing, supports a wider variety of tests, and is generally safer and better defined than [ .. ]
. For an in-depth list of differences, see the Related Resources.
This check is not enabled by default, and may have been turned on for your current project by someone who wants it enforced. You can still ignore it with a directive.
This suggestion does not trigger for Sh or Dash scripts, even when explicitly enabled, as these shells don't support [[ .. ]]
.
- BashFAQ 031: What is the difference between test, [ and [[ ?