On 2019-01-25 18:31, Michael Orlitzky wrote:
On 1/25/19 11:32 AM, Kai Peter wrote:
Really interesting _how_ people think. Find the error:
You're not even trying:
$ echo 0.0.0.0 | sed 's/\.0/\./g' | sed 's/^0//g' | \
sed 's/\.0/\./g' | sed 's/\.\./.0./g' | sed 's/^0//g'
.0..
True,
On 1/25/19 11:32 AM, Kai Peter wrote:
>
> Really interesting _how_ people think. Find the error:
>
You're not even trying:
$ echo 0.0.0.0 | sed 's/\.0/\./g' | sed 's/^0//g' | \
sed 's/\.0/\./g' | sed 's/\.\./.0./g' | sed 's/^0//g'
.0..
It's trivial to enumerate all "valid" (that is,
On 2019-01-24 17:40, Michael Orlitzky wrote:
On 1/24/19 4:00 AM, Gerrit Kühn wrote:
---
[me@you ~]# ip=01.02.00.0004; for d in $(echo "${ip}"|tr '.' '\n');
do myip="${myip}"$(printf "%i" "${d}")"." ; done; echo ${myip%.}
1.2.0.4
That turns "010" into "8". Using a real programming language
On 1/24/19 4:00 AM, Gerrit Kühn wrote:
---
[me@you ~]# ip=01.02.00.0004; for d in $(echo "${ip}"|tr '.' '\n');
do myip="${myip}"$(printf "%i" "${d}")"." ; done; echo ${myip%.}
1.2.0.4
That turns "010" into "8". Using a real programming language with a
parser is only heavyweight compared to
On Wed, 23 Jan 2019 16:45:59 -0500 Michael Orlitzky wrote
about Re: [gentoo-user] Re: OT scripting - strip zero if between period
and digit:
> > This is not a good application for a regex.
> Since that doesn't seem to be stopping anyone, here's my entry.
Since the only alternative to
On 1/23/19 2:24 PM, Grant Edwards wrote:
This is not a good application for a regex.
Since that doesn't seem to be stopping anyone, here's my entry.
sed
On 2019-01-23, Alexander Kapshuk wrote:
> On Wed, Jan 23, 2019 at 9:41 PM Grant Edwards
> wrote:
>> On 2019-01-23, Alexander Kapshuk wrote:
>>
>> > This any better? :-)
>> >
>> > echo '198.088.0.01
>> > 198.088.062.01
>> > 198.088.0.001' | sed -r 's/\.0+([^.0]+)/.\1/g'
>>
>> I guess it's
On 1/23/19 3:08 PM, Alexander Kapshuk wrote:
The OP stated that there were no leading zeros in the first octet of
the IP address, so that case did not need to be handled.
$ echo "1.00.3.4" | sed -r 's/\.0+([^.0]+)/.\1/g'
1.00.3.4
On Wed, Jan 23, 2019 at 9:41 PM Grant Edwards wrote:
>
> On 2019-01-23, Alexander Kapshuk wrote:
>
> > This any better? :-)
> >
> > echo '198.088.0.01
> > 198.088.062.01
> > 198.088.0.001' | sed -r 's/\.0+([^.0]+)/.\1/g'
>
> I guess it's 'better', but it's still broken:
>
> $ echo '003.4.5.6' |
On 2019-01-23, Alexander Kapshuk wrote:
> This any better? :-)
>
> echo '198.088.0.01
> 198.088.062.01
> 198.088.0.001' | sed -r 's/\.0+([^.0]+)/.\1/g'
I guess it's 'better', but it's still broken:
$ echo '003.4.5.6' | sed -r 's/\.0+([^.0]+)/.\1/g'
003.4.5.6
This is not a good application for
On Wed, Jan 23, 2019 at 4:10 PM Grant Edwards wrote:
>
> On 2019-01-23, Alexander Kapshuk 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
On 2019-01-23 18:26, Neil Bothwick wrote:
On Wed, 23 Jan 2019 14:09:45 - (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
On Wed, 23 Jan 2019 14:09:45 - (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
On 2019-01-23, Alexander Kapshuk 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
--
Grant Edwards grant.b.edwards
14 matches
Mail list logo