📜  bash 结合退出命令和退出代码来构建快速逻辑 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:49:36.234000             🧑  作者: Mango

代码示例1
$ my_command && echo "Done" || echo "Failed"
$ /usr/bin/rsnapshot daily && echo "Backup successful" || echo "Backup failed. Alerting OPS team..."
$ mkdir /opt/kernel && cd $_ && echo "Directory created and you are in $PWD"