这是我试图正确的代码,但我知道它在逻辑上是不正确的,因为!
它只绑定到第一个测试。
# if Vim was compiled in the same month, skip.
if ! [[ -f /usr/local/bin/vim ]] && /usr/local/bin/vim --version | grep "compiled $(date +%b) [0-9]{1,2} $(date +%Y) " -
我知道它在逻辑上是错误的原因是:
$ if ! [[ a == b ]] && [[ c == c ]]; then echo yy; fi
yy
$ if ! [[ a == a ]] && [[ a == c ]]; then echo yy; fi
$