| re: Linux SED (help on replacement)
Hello, thanks for replying
I know this can work with moving around replace strings, but I ahve many replace strings and the the files I would like to update are also multiple. The above example was to simplify the behaviour I would like to achieve. I was wondering if there is anyway for sed to only replace the content once rather than replacing already replace matches, as I think it runs each match and replace case with the whole file one at a time.
I have no idea if the solutions exists for this or not. Almost all other utilities do the same thing with replacements as it is easiest way to do.
BTW, I am only considering character replacements in my actual work, so at each point only one character is required to be matched from all the cases i.e:
>sed "s/a/b/g" file
So the omplexity is less as all the match cases only have a character to match from the listed cases, Rather than a mixture of strings of different length to match.
If I do not find anything I may have to implement one myself :), hopefully I will find something.
|