您的位置:首页 > 运维架构 > Shell

029_shell编写工作常用工具类总结

2018-10-08 15:09 351 查看

一、检查命令的执行结果

function check_result() {
result=$?
flag=$1
if [[ "$result"x == "0"x ]];then
echo "###############$flag is OK.###############"
else
echo "###############$flag is Failed.###########"
exit -1
fi
}

调用

check_result "cat conf/channel.conf > flume-agent.properties"

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: