I'm writing a script to pull the DB information from a wp-config.php file and use that to login to mysql and then run a command to create a new user.
Yes this sounds like a major hacker script but I'm more trying to troubleshoot.
For purposes of shortening up this post I'll summarize the first part:
db=user_database
usr=user_databaseuser
ps=database_password
qr=mysql command
mysql --user=$usr --password=$ps $db
Now here is where I have troubles, I have another variable $qr that I'm trying to call once logged into mysql. I have tried:
-e $qr
on the end of that mysql command to login. When I try to use that method it does not do anything. I have also tried:
mysql --user=$usr --password=$ps $db < cat $qr or < echo $qr
With these ones I get a syntax error reporting cat and echo as an unknown command.
foo < cat xdoesn't make any sense. What you probably mean iscat x | fooThe argument to<or>must be a filename, not another command.$qr(and if it still doesn't work, useset -x...)--defaults_file.