How can I substitute/remove 0's in this, using sed:2001:0db8:03cd:0000:0000:ef45:0006:0123to make it looks like this:2001:db8:3cd:::ef45:6:123There are 8 pieces of 4's divided by : in the middle.The first piece of 4 must not lose any 0's and from the other ones, only the leading 0's can be removed.
How to use sed to selectively remove leading zeros
shell;text processing;sed