&& for logical AND. Single & will
background and return true.if [ "$1" = "install" ] & [ "$USER" != "root" ]
then
echo "Must be root to install"
fiif [ "$1" = "install" ] && [ "$USER" != "root" ]
then
echo "Must be root to install"
fiShellCheck found a test command followed by a
&. This runs the test in the background, effectively
ignoring it. To specify "logical AND" between two commands, use
&&.
None
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.