How to run bash command during redirect << EOF
问题 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. 回答1: You can use system command from within the mysql command line client: #!/bin/bash mysql -uUser -pPasswd << EOF system