I'm busy writing basic migration scripts for some WP sites, and I'm trying to automate the creation of the mysql database and user credentials from reading the wp-config file
how can I read the following variables from the wp-config file, so that I actually get 3 variables in a bash script:
define('DB_NAME', 'somedbname'); define('DB_USER', 'someusername'); define('DB_PASSWORD', 'somerandompassword');
For example, my result should effectively give me:
WPDBNAME=somedbname WPDBUSER=somedbuser WPDBPASS=somerandompassword
variables scripting bash shell
anthonysomerset
source share