On 2019-01-23 18:26, Neil Bothwick wrote:
On Wed, 23 Jan 2019 14:09:45 -0000 (UTC), Grant Edwards wrote:
> How about this one?
>
> echo '198.088.0.01
> 198.088.062.01' | sed 's/\.0\([0-9][0-9]*\)/.\1/g'
> 198.88.0.1
> 198.88.62.1
Also no.
$ echo 198.088.0.001 | sed 's/\.0\([0-9][0-9]*\)/.\1/g'
198.88.0.01
This is like playing Whack-a-Mole with sed ;-)
That's the fun ;-)
I think the truth is in the middle between a twelve-pages-script and a
one-liner. Split it, 'sed' it, check result, correct result if required,
combine it.
--
Sent with eQmail-1.11 beta - a fork of djb's famous qmail