All posters talking about 0 are true, and 1 - false, missed the point. In this case, 1 is true, and 0 is false in the usual Boolean sense due to the context of evaluating arithmetic caused by $(()) .
The == operation inside $(()) not an equality of return statuses in Bash, it performs numerical equality using literals where "false" and "true" are considered as variables, but they have not been interpreted as 0 yet, since they are still not assigned:
$ echo $((true)) 0 $ echo $((false)) 0
If you want to compare the return status true and false, you want something like:
true TRUE=$? false FALSE=$? if (( $TRUE == $FALSE )); then echo TRUE; else echo FALSE; fi
But I'm not sure why you would like to do this.
EDIT: Fixed part of the original answer stating that "true" and "false" are interpreted as strings. They are not. They are considered as variables, but not yet tied to them.
zostay Dec 20 '11 at 17:37 2011-12-20 17:37
source share