I am trying to use
sed to add a string after a certain pattern but I want to exclude the case where the additional string is already present.
"text.txt" Hello Bar Hello world!
If I use
sed -i -e 's/Hello/Hello world!' text.txt the third line becomes
Hello world! world!
but I would like to keep it intact.
I have found this related question but not all the lines in my file need to be modified.
Has anyone got recipe for this?