Why does the following output True
?
#!/bin/sh
if [ false ]; then
echo "True"
else
echo "False"
fi
This will always output True
even though the condition would seem to indicate otherwise. If I remove the brackets []
then it works, but I do not understand why.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…