I am trying to update some legacy php code via some sed substitutions running in a bash script.
Some items seem to work fine; others not so much. The issue appears to be when the substitution strings contain single or double quotes.
I have tried a variety of means of escaping the quotes; but, have had no success.
Here is an example line from my bash script:
[pre]/usr/bin/sed -i 's/(session_is_registered('ADMIN')/$_SESSION["group_code"]=='ADMIN'/g' /home/impact/php_repair_temp/*.php[/pre]
I wish to replace: session_is_registered('ADMIN')
With: $_SESSION["group_code"]=='ADMIN'
Other substitutions without quotes in the string are working fine...
TIA,
-Allen M.
Some items seem to work fine; others not so much. The issue appears to be when the substitution strings contain single or double quotes.
I have tried a variety of means of escaping the quotes; but, have had no success.
Here is an example line from my bash script:
[pre]/usr/bin/sed -i 's/(session_is_registered('ADMIN')/$_SESSION["group_code"]=='ADMIN'/g' /home/impact/php_repair_temp/*.php[/pre]
I wish to replace: session_is_registered('ADMIN')
With: $_SESSION["group_code"]=='ADMIN'
Other substitutions without quotes in the string are working fine...
TIA,
-Allen M.