I have file with parameters:
key1: 'testValue'
And I want to change the value of the key1
(testValue
) according to parameter.
This one is working with hard-coded value:
sed -i "s/\(key1:\).*/\1 'newValue'/" ./myFile
I tried with dynamic value:
MY_NEW_VALUE= testNewValue
sed -i "s/\(key1:\).*/\1 ${MY_NEW_VALUE}/" ./myFile
And I got am error:
sed: -e expression #1, char 32: unknown option to `s'