construct a sql , assign it to a variable and execute inside shell script
You need to do it like this:

query="select count(*) from information_schema.tables where TABLE_SCHEMA not in ('mysql','performance_schema','information_schema') and engine!='INNODB'"
mysql -uroot -p -e"${query}"


or

query="select count(*) from information_schema.tables"
query="${query} where TABLE_SCHEMA not in"
query="${query} ('mysql','performance_schema','information_schema')"
query="${query} and engine!='INNODB'"
mysql -uroot -p -e"${query}"


Double quotes do not need to be part of the query variable