Scripting in Baxh with MySQL
In my script, I am running a query against mysql, which works great, but I am having trouble storing that information in a variable.
#bash shell
#This statement works fine by itself
mysql -u user1 -ppass1 -s -e "select count(*) as z from db1.table1 where username='$1' and preference='block_all'"
#bash shell
#This is what I want to do, but it doesn't work
variable1 = mysql -u user1 -ppass1 -s -e "select count(*) as z from db1.table1 where username='$1' and preference='block_all'"asdfa
Any help getting this infor into a variable would be greatly appreciated!
Tim
|