Couldn't find 'fi' for this 'if'
1# SH-1046
2if true 3then
4 echo "True"
5done
Description
Problematic code:
if true
then
echo "True"
done
Preferred code:
if true
then
echo "True"
fi
Detected an if
statement that does not appear to have a matching terminating fi
.
This could be because it's missing entirely, or because the if
statement was incorrectly terminated by a mismatched done
, esac
, )
or something similar.
A companion warning SH-1047
is emitted at the point where ShellCheck expected the fi
.
Check that the if
statement is completely and correctly terminated.