What is the difference between:if echo  T  | grep -q  F ; then echo FOUND; else echo NOT; fiAnd:if ; then echo FOUND; else echo NOT; fiThe output of first command is:NOTThe output of second command is:: command not found NOTBoth should behave in the same way, I think.
If empty condition behaviour
bash;shell;grep
: command not foundThis means that the command provided as condition in the if statement is not found. That command  is just an empty string and therefore not found; there is no such command.According to the manual page of bash, the syntax of an if statement should look as follows:if list; then list; [ elif list; then list; ] ... [ else list; ] fiA list is a sequence of one or more pipelines separated by one of the  operators ;, &, &&, or ||, and optionally terminated by one of ;, &,  or .So, in the if statement above the list is executed and an exit code of 127 came back and an error is trown that the command is not found. This is then evaluated as false, therefore the else block is executed.What you may want is something as follows:if false; then echo FOUND; else echo NOT; fi