You need spaces around [
and ]
. Say:
if [ "$filespresent" == "false" ]
[
is a command. Saying ["$filespresent"
causes the shell to interpret it as one token and not a command.
The ==
operator is not available in sh
, use =
instead:
if [ "$filespresent" = "false" ]