Answer the question
In order to leave comments, you need to log in
How to execute grep results in bash script?
grep "^\$DB.*;" /home/bitrix/ext_www/site.ru/bitrix/php_interface/dbconn.php | sed 's/;//g'
$DBType = "mysql"
$DBHost = "localhost"
$DBLogin = "site"
$DBPassword = 'pYa%W&cwsA]kK[QH'
$DBName = "dbcentre"
$DBDebug = false
$DBDebugToFile = false
Answer the question
In order to leave comments, you need to log in
Something like this
eval `sed -rn 's/^\$(DB.+);$/\1/p' /home/bitrix/ext_www/site.ru/bitrix/php_interface/dbconn.php`
grep >> (add to the desired file) superduper PS
will
add to the end of the file
if you need "exactly where to shove", (beginning / end / instead of / between lines)
then gray or pearl,
first add the grep exhaust to the file,
only then execute
it
PS
the question is clear, with a trick?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question