Evening. I am trying to capture the output of a mySQL query into a bash variable, without much luck...
I have:
But this is failing. I have tried various permutations on the above - any ideas?
Cheers,
Ben
I have:
Code:
#!/bin/bash
HOURS=0
MINS=0
SECS=0
SMTP=""
DB_USER="xxxx"
DB_PASS="yyyy"
TABLE="zzzz"
QUERY='mysql -u ${DB_USER} -p${DB_PASS} -e"<<EOF
SELECT update_time
FROM information_schema.TABLES
WHERE TABLE_NAME = \'${TABLE}\'"
'EOF
But this is failing. I have tried various permutations on the above - any ideas?
Cheers,
Ben