一、脚本内容 #!/bin/bash . /etc/profile . ~/.bash_profile # 报错退出 error() { if [[ $? != 0 ]]; then echo "$@ 运行失败" #事务回滚机制 sh ~/bee_u_e.sh "drop table if exists tmp.nidaye_${pt}" exit 1 fi } #脚本使用说明