I have a config.py file with parameters defined as
class A:
path='/a/b/c'
...
class B:
path='/d/e/f'
...
I am trying to modify parameter path
in class A
in config.py
using sed -i
from a Bash script:
sed -i <script to replace path value with /x/y/z/ in class A> config.py
expected result:
class A:
path= '/x/y/z'
...
class B:
path= '/d/e/f'
...
I worked out how to print the value of path variable using this:
sed -i '/A/,/path/p' config.py
How can I replace the value though?