In fish, true
seems to equal 0
:
❯ if true == 0; echo "YES"; else; echo "NO"; end
YES
But false
seems to not equal 1
:
❯ if false == 1; echo "YES"; else; echo "NO"; end
NO
In bash both of them are not equivalent to their numeric value:
$ if [ true == 0 ]; then echo "YES"; else echo "NO"; fi
NO
$ if [ false == 1 ]; then echo "YES"; else echo "NO"; fi
NO
It seems strange that fish would be consider one truth value equal to its numeric counterpart but not the other.
Maybe there is an explanation for that?