In a script just write this, and play with the mysql options to get what you want.

SHELLVARIABLE=` mysql --skip-column-names dataBase -e "SELECT COUNT(*) from TableAAA"`

and then u can do somethink like

ehco $SHELLVARIABLE

This is a tip.

Bye.