I have a sed command something like this to comment out a particular line based on a particular pattern:
sed -e '/$OLD_VERSION/ s/^#*/#/' -i /ws/usernam/workspace/scripts/raw-vobs-config-spec
Here we need to comment out the line containing $OLD_VERSION
. I have passed $OLD_VERSION
as a parameter in my shell script.