Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: OT scripting - strip zero if between period and digit
Date: Wed, 23 Jan 2019 17:27:04
Message-Id: 20190123172651.15b57976@digimed.co.uk
In Reply to: [gentoo-user] Re: OT scripting - strip zero if between period and digit by Grant Edwards
1 On Wed, 23 Jan 2019 14:09:45 -0000 (UTC), Grant Edwards wrote:
2
3 > > How about this one?
4 > >
5 > > echo '198.088.0.01
6 > > 198.088.062.01' | sed 's/\.0\([0-9][0-9]*\)/.\1/g'
7 > > 198.88.0.1
8 > > 198.88.62.1
9 >
10 > Also no.
11 >
12 > $ echo 198.088.0.001 | sed 's/\.0\([0-9][0-9]*\)/.\1/g'
13 > 198.88.0.01
14
15 This is like playing Whack-a-Mole with sed ;-)
16
17
18 --
19 Neil Bothwick
20
21 I know corn oil comes from corn, where does baby oil come from?

Replies

Subject Author
Re: [gentoo-user] Re: OT scripting - strip zero if between period and digit Kai Peter <kp@×××××××××××××××.org>