Convert mysql count(*) to int in bash?
You could suppress the tab column name by:
ROW_CNT=$(mysql --raw --batch -e 'select count(*) from mydb.mydb' -s)
echo $ROW_CNT
Also, the semicolon at end your SQL command is unnecessary
You could suppress the tab column name by:
ROW_CNT=$(mysql --raw --batch -e 'select count(*) from mydb.mydb' -s)
echo $ROW_CNT
Also, the semicolon at end your SQL command is unnecessary