Device ID: j01-01, IP address: 10.10.10.36, IP address: 10.10.10.35, IP address: 10.10.102.201, Platform: 8040, Capabilities: Host ,
Interface: GigabitEthernet9/45, Port ID (outgoing port): e0k,
Here is what I have so far but it didn't work.
sed -i -e 's/, IP address: / /g' -e 's/, IP address: / /1' $tempdir/newt4
This is the intended output
Device ID: j01-01, IP address: 10.10.10.36 10.10.10.35 10.10.102.201, Platform: 8040, Capabilities: Host ,
Interface: GigabitEthernet9/45, Port ID (outgoing port): e0k,
------ Post updated at 07:39 PM ------
I also tried:
sed -ri 's/(\IP address:)(, IP address:)(Platform:)/\1\3/g'
sed -e 's/, IP address: /, IP address: /' -e 's/, IP address: / /g' newt4
Initially you cannot use the /g search because the first string is quite identical with the next occurrences.
Fortunately you want the first string a bit changed in the output, so the trick is to change it first. Then the /g search can be made to only match the next occurrences.