I heard this was possible but from my research I haven't been able to figure it out yet. Seems it should be simple enough. Basically from a high level view I'm trying to accomplish...
Code:
. $X='grep foo blah.log'
then 'mysql command SELECT foo FROM bar WHERE ' . $X
or something like that.
This is part of my script:
Code:
cid=$(awk '{ print $2 }' /home/test.txt | sed -n 2p)
echo "cid is" $cid
cat /home/my2.sql | /home/build/env/util/connectdb.sh biller > /home/test2.txt
cat /home/test2.txt
In the my2.sql file:
Code:
select * from Notifications join Events using (EventId) where CustomerId = '&cid';
Any suggestions? Possible? If so what am I doing wrong?
Thanks
David