I am really enjoying working with sed. I am trying to come up with a sed command to replace some occurrences (not all) in the same line, for instance:
I have a command which the output will be:
200.300.400.5 0A 0B 0C 01 02 03
being that the last 6 strings are actually one MAC address
I wanted to re-write the output of the command so it will come out like this:
200.300.400.5 0A0B.0C01.0203
Considering space " " as a delimiter, it will ALWAYS join 2nd and 3rd fields, then replace " " with "." between 3rd and 4th fields, join 4th and 5th fields, replace " " with "." between rth and 6th fields.
It can be something other than sed as well.
It is a bonus if the script also transform "CAPS" into "small caps"
200.300.400.5 0a0b.0c01.0203
Cannot find how to make sed replace certain occurrences on the same line!