0
how could it be done for me to copy a php file via shell script, but replace the contents of a variable?
Example: cat config-sample.php > config.php
<?php $senha="[dados_a_ser_substituido]";?>
0
how could it be done for me to copy a php file via shell script, but replace the contents of a variable?
Example: cat config-sample.php > config.php
<?php $senha="[dados_a_ser_substituido]";?>
Browser other questions tagged linux shell-script
You are not signed in. Login or sign up in order to post.
And you cannot create a php terminal file with
var_export();
to change the value of the variables?– Guilherme Nascimento
Could, you know tell me what would be the syntax for this or where to get this information?
– Victor M.
I usually use the sed command, in your case after copying the file try this command:
sed -i 's/<?php $senha=".*;?>/<?php $senha="dados_que_eu_desejo";?>/g' config.php
– Miguel Silva
Miguel It worked perfectly, there is some way to give 2 or more Places in the same line?
– Victor M.