Similarly, the || control operator separates two commands and runs the second command only if the first command returns a non-zero exit status.
类似地,|| 控制操作符分隔两个命令,并且仅当第一个命令返回非零退出状态时才运行第二个命令。
Run a command only if another command returns a non-zero exit status.
仅当另一个命令返回非零退出状态时才运行某个命令。
Notice that when you run the command, the if statement for the last exit status is never reached because the script exits upon a non-zero return status of the cp command.
注意,当您运行该命令时,实现最终的退出状态的if语句将永远无法满足条件,因为脚本在遇到cp命令的非零返回状态时将退出。
应用推荐