看起来变量没有得到填充,尽管理论上应该这样。 我错过了什么吗?
echo "Setting up: $db"
cat <<EOF > ./mysql_setup.sql
create database $db;
grant all on $db.* To $adm_user@localhost identified by '$adm_pass' WITH GRANT OPTION;
grant all on $db.* To $adm_user@'%' identified by '$adm_pass' WITH GRANT OPTION;
EOF
echo "quit" >> ./mysql_setup.sql