Hello
I am working on a script where I need to replace the particular line with new line
Old line is
<outputFileNameMapping>${artifact.artifactId}-${project.version}.${artifact.extension}</outputFileNameMapping>
and new line is
<outputFileNameMapping>${artifact.artifactId}-${project.assembly.version}.${continuum.project.nextBuild.number}-Release.${artifact.extension}</outputFileNameMapping>
I tried to do it through sed command but no luck
Thanks
RudiC
2
Show the sed script you used and what failed.
I was using the below command to do it
old_runtime_version=<outputFileNameMapping>${artifact.artifactId}-${project.version}.${artifact.extension}</outputFileNameMapping>
new_runtime_version=<outputFileNameMapping>${artifact.artifactId}-${project.assembly.version}.${continuum.project.nextBuild.number}-Release.${artifact.extension}</outputFileNameMapping>
find ${BRANCH_NAME}/A/B/pom.xml -type f -exec sed -i "s/$old_runtime_version/$new_runtime_version/g" {} \;
getting below error
sed: -e expression #1, char 114: unknown option to `s'
RudiC
4
May I guess that there's a "/" in one of your variables?
add:
sed -i "" "s/$old_runtime_version/$new_runtime_version/g" {} \;
Both the variables has been mentioned in my above post old_runtime_version and new_runtime_version.
I tried your command and it is not working.Please suggest