I have a string in my .sh file
Path="etc/name"
This I need to write into a file.
This is my File.txt
Name:Tom
My_Path:add path here
Address:Xyz
Here in this file I need to replace path by the 'path' variable in shell script.
I used
sed -i -e "s/\(My_Path=\).*/\1$path/" file.txt
But getting error like :
Sed: -e expression #1, unknown option to s
my desired output is , the file My_Path.txt should contain
Name:Tom
My_Path:"etc/name"
Address:Xyz