$ false
$ echo $?
1
$ if [[ false ]]; then echo 'do it'; fi
do it
$ test false && echo 'do it'
do it
$ COND=false
$ echo $COND
false
$ if [[ $COND -ne 0 ]]; then echo 'do it'; fi
$ if [[ $COND -ne true ]]; then echo 'do it'; fi
This is nonsense IMO, what am I missing here?
-- Update
So the following is how it goes:
$ COND=false
$ if ! $COND; then echo 'do it'; fi
do it
$ if $COND; then echo 'do it'; fi
But I want to combine $COND with other conditional expressions in one larger test expression (or [[ {expr} && {expr} ]]). So when $COND is false it's not working inside an [[ {expr} ]] in an intuitive manner. It seems the [[ {expr} ]] is a bit misleading when what I need is more like:
$ COND=false
$ if ! $COND && test -d ${HOME}/bin ; then echo 'do it'; fi
do it