Pattern: Use of [ ]
for test in Bash/Ksh
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 [ .. ]
.
Example of incorrect code:
[ -e /etc/issue ]
Example of correct code:
[[ -e /etc/issue ]]