Solved bash to shell conversion help

Hi,
I am trying to automated my wordpress installation on my FreeBSD web server and I have managed to get everything working but this bit:
Code:
# setup wp-config.php
wp core config --dbhost=$dbhost --dbuser=$dbuser --dbpass=$dbpass --dbprefix=$dbprefix$prefix --dbname=$dbname <<PHP
define( 'WP_DEBUG', true );
define( 'DISALLOW_FILE_EDIT', true );
define( 'WP_MEMORY_LIMIT', '64M' );
PHP
My script is written with #!/bin/sh but the script above was originally develloped for #!/bin/bash -e...

Could anyone please help my undersdand wjy when I run the above script, none of the 'define' line are in the final file?

Thank you
 
I know this sounds like a stupid question but ... does this snippet indeed create the expected result when you run it in bash? I'm asking this because the only shell features I can see used here are normal variable expansions and a heredoc, both should work with any /bin/sh.
 
Irrelevant, but I find here-documents more readable (or maybe just more beautiful) when laid out as
Code:
<< EOF sed s/dog/cat/g
some random
input
EOF

matter of taste, obv
Juha

is the $dbprefix$prefix as it should, in your snippet, it looks different from the other arguments.
 
Thank you all for your help :)
I managed to get it working and it turned out that I missed the --extra-php from
Code:
wp core config --dbhost=$dbhost --dbuser=$dbuser --dbpass=$dbpass --dbprefix=$dbprefix$prefix --dbname=$dbname --extra-php <<PHP
define( 'WP_DEBUG', true );
define( 'DISALLOW_FILE_EDIT', true );
define( 'WP_MEMORY_LIMIT', '64M' );
PHP
 
Back
Top