(1)command1;command2
使用";"时,不管command1是否执行成功都会执行command2.
(2)command1 && command2
使用"&&"时,只有command1执行成功后,才会执行command2,否则command2不执行.
(3command1 || command2
使用"||"时,command1执行成功后,不执行command2,否则会执行command2,总之command1和command2总有一条要执行
转载于:https://blog.51cto.com/xxr007/1883152