Suppose I use a function in an if statement:
if isSomeConditionTrue; then
echo "true";
else
echo "false";
fi
This works fine if isSomeConditionTrue is defined.
However, if isSomeConditionTrue is not defined, e.g. due to a typo or a missing import, it evaluates to "false" rather than failing.
set -u doesn't make a difference.
Aucun commentaire:
Enregistrer un commentaire