[ true ], just use
if [ true ] then echo "always triggers" fi
if true then echo "always triggers" fi
This is a stylistic suggestion to use
true instead of
[ true ].
[ true ] seems to suggest that the value "true" is somehow relevant to the statement. This is not the case, it doesn't matter. You can replace it with
[ false ] or
[ wombat ], and it will still always be true:
|String||In brackets||Outside brackets|
It's therefore better to use it without brackets, so that the "true" actually matters.
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.