如何捕获我在Shell脚本中执行的Beeline命令的返回代码。如下所示:
beeline -u $Beeline -e "ALTER TABLE DROP if exists partition (date='');“
我想在shell脚本中捕获上述查询的状态。
感谢AG
发布于 2018-08-01 01:44:59
$?捕获前一条语句的返回码。将结果存储在变量中或使用$?进行更多处理。
beeline -u $Beeline -e "ALTER TABLE DROP if exists partition (date='');"
rc=$?
#do whatever with $rc herehttps://stackoverflow.com/questions/51615821
复制相似问题