Regex Sed command replacement
In my php.ini I have
error_reporting = E_ALL
I want to change it to
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
with sed command
sed -i "s/^error_reporting = .*/error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT/" /etc/php5/apache2/php.ini
I get a different result:
error_reporting = E_ALL error_reporting = E_ALL ~E_DEPRECATED error_reporting = E_ALL ~E_STRICT
but it should be
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
BTW, the sed command is in the bash script.
+3
source to share