bash - Escape variable in Jenkins shell execution -


we use jenkins run wordpress cli stuff us, , pass in php wordpress cli. example:

cd wordpress && wp core config --skip-check --dbhost=dbhost --dbname=dbname --dbuser=user --dbpass=pass --extra-php <<php define('host', $_server['http_host']); php 

jenkins interprets $_server , i'm left ['http_host']. how can escape $_server?

i've tried doing define('host', \$_server['http_host']);, still gets interpreted variable.

figured out... wrap first section of defining heredoc in double quotes.

cd wordpress && wp core config --skip-check --dbhost=dbhost --dbname=dbname --dbuser=user --dbpass=pass --extra-php <<"php" define('host', $_server['http_host']); php 

it no longer interprets $_server.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -