I have a file named webroot with below contents:
ROOT= .
#ROOT = Current Directory for Installers. Specify in double quotes.
I want to replace value foe first occurrence of ROOT with the path in double quotes, for which I created below script
#!/bin/bash
ppath="$(dirname $(pwd))"
sed -i '0,/^ROOT.*/s/^ROOT.*/ROOT = \"\${ppath}\"/' webroot
grep -m1 ROOT webroot
However, when I execute the script, I see below as output:
ROOT = "${ppath}"
Updated the script to below, however same result:
#!/bin/bash
ppath="$(dirname $(pwd))"
sed -i "0,/^ROOT.*/s/^ROOT.*/ROOT = \"\${ppath}\"/" webroot
grep -m1 ROOT webroot
Any suggestions, how this can be fixed?