在 bash 中,我不明白为什么第三个命令不正确:
[[ 1 -eq 1 ]] # $? is 0 [[ ! 1 -eq 1 ]] # $? is 1 [[ ! ! 1 -eq 1 ]] # $? is 1 (??) [[ ! ( ! 1 -eq 1 ) ]] # $? is 0
如果我1 -eq 1用任何真表达式替换,并用任何假表达式否定,它似乎会做同样的事情。
1 -eq 1
bash shell command-line
bash ×1
command-line ×1
shell ×1