I know there's some way to run bash command during redirect, but I don't know how exactly it is done.
I want to do something like this:
#!/bin/bash
mysql -uUser -pPasswd << EOF
echo 'I wanna echo something by using echo which is run by bash'
use Mydb
some sql commands here
commit;
EOF
I had ever done that by mistake by using " in the "<< EOF" , but failed to make it now.