Answer the question
In order to leave comments, you need to log in
How to solve the shielding problem?
I am writing a script on the bash, but the choice of variables from the config has to be done in PHP
and everything is great up to the place where I cram the variable
We declare everything there
#!/bin/sh
SITEDIR="/home/bitrix/ext_www"
DBCONN="bitrix/php_interface/dbconn.php"
TMPDIR="/var/backup/site"
.....
DBPASS=$(/bin/php -r 'include "/home/bitrix/ext_www/site.ru/bitrix/php_interface/dbconn.php"; echo "$DBPassword";')
DBPASS=$(/bin/php -r 'include "$SITEDIR/$ELEMENT/$DBCONN"; echo "$DBPassword";')
' '
how much I understand and what to do? Answer the question
In order to leave comments, you need to log in
DBPASS=$(/bin/php -r "include '$SITEDIR/$ELEMENT/$WEB/$DBCONN'; echo \$DBPassword;")
$VAR
a PHP variables with a backslash before $ -\$DBPassword
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question