I have a text file say file.txt containing following data:
APP_ARTIFACT=xxxx
APP_DOMAIN=xxx
APP_NAME=xxx
APP_OWNER_EMAIL=xxx
APP_PATH=xxx
IMAGE=dockerhub.ccc.xx.net:5005/aaa/xxx-rhel7:2.4
NAMESPACE=xxx
PAAS=xxxnce1
Now, I want to write a script in .sh which can replace the version after 'IMAGE=dockerhub.ccc.xx.net:5005/aaa/xxx-rhel7:' to a different version.
It means i want to replace 2.4 (or it may contain some other string as well) with some other string., while keeping the rest of the file as it is. How can I do this using some inbuilt linux tool like 'sed'?
after replacing the string containg version with 'mystring;, the expected output after substitution should be :
APP_ARTIFACT=xxxx
APP_DOMAIN=xxx
APP_NAME=xxx
APP_OWNER_EMAIL=xxx
APP_PATH=xxx
IMAGE=dockerhub.ccc.xx.net:5005/aaa/xxx-rhel7:mystring
NAMESPACE=xxx
PAAS=xxxnce1