for the variable
dbnya="echo $(date +%Y%m%d%H%M%S)"
When running below code, I will get an error (SQL syntax error)
mysql -u root -pthepass -e "CREATE DATABASE demo$dbnya CHARACTER SET utf8 COLLATE utf8_bin"
The second command will work if I'm using dbnya=20120423230524
as first command
echo 2012042323524
, the SQL command isCREATE DATABASE demoecho 2012042323524 CHAR...
-- note the extraneous string "echo " – glenn jackman Apr 23 at 16:42