我看到了类似的东西
if ! some-command; then
#do something
fi
感叹号有什么作用?我看到如果你使用括号,it can be used for negation .
这里的效果一样吗?
最佳答案
如 man bash
中所述:
If the reserved word
!
precedes a pipeline, the exit status of that pipeline is the logical negation of the exit status as described above.
关于bash - 感叹号是否代表 Bash IF 条件中的否定?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41495350/