I'm attempting to replace a string on bash script with the following
sed -i -e \"s/__BUILD_NUMBER__/${version}.${BUILD_NUMBER}/g\" -e \"s/__BUILD_TIMESTAMP__/${BUILD_TIMESTAMP}/g\" package.json
But I'm getting the following error
sed: -e expression #1, char 24: unknown option to `s'
these are the values of the variables
version= ase/bab/BAB
BUILD_NUMBER= 2.11.0.7
BUILD_TIMESTAMP= 2024-03-27_14-37-04
I guess your command should be corret.You need to escape the sashes in your variabl with backslash: