1
votes

How to capture the return code of the Beeline command that I am executing within a Shell Script. Like Below:

beeline -u $Beeline -e "ALTER TABLE DROP if exists partition (date='');"

I want to capture the status of above query with in shell script.

Thanks AG

1

1 Answers

0
votes

$? captures the return code of the previous statement. Store the result in a variable or use $? for more processing later.

beeline -u $Beeline -e "ALTER TABLE DROP if exists partition (date='');"
rc=$?
#do whatever with $rc here