Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Feb 2014 17:02:14 -0800
From:      <dteske@FreeBSD.org>
To:        "'Tom Evans'" <tevans.uk@googlemail.com>
Cc:        rc@freebsd.org, 'Devin Teske' <dteske@freebsd.org>
Subject:   RE: network.subr _aliasN handling
Message-ID:  <11bd01cf2f69$ba7d5040$2f77f0c0$@FreeBSD.org>
In-Reply-To: <CAFHbX1JOKjJxkvgOLY0rkLCUAGLM5pYXOdJ2AoY47sxUCe_G=Q@mail.gmail.com>
References:  <20131228055324.GA72764@aim7400.DataIX.local> <A7699871-A170-4AD5-B740-ED8BE17C7107@fisglobal.com> <9498BE8E-8090-4E7A-8317-18D29B1DDC08@dataix.net> <7DBA7D58-E925-47BC-967C-F653348426A6@fisglobal.com> <A15FAFBD-4597-4D8D-A014-0D486573894C@dataix.net> <AFFFCC9A-8C21-4C0B-A8D9-457E4C26DDA3@fisglobal.com> <CAFHbX1JOKjJxkvgOLY0rkLCUAGLM5pYXOdJ2AoY47sxUCe_G=Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help


> -----Original Message-----
> From: Tom Evans [mailto:tevans.uk@googlemail.com]
> Sent: Friday, February 21, 2014 9:16 AM
> To: Devin Teske
> Cc: rc@freebsd.org
> Subject: Re: network.subr _aliasN handling
> 
> On Sat, Jan 4, 2014 at 11:25 AM, Teske, Devin <Devin.Teske@fisglobal.com>
> wrote:
> > On Jan 4, 2014, at 2:59 AM, Jason Hellenthal wrote:
> >
> >> I believe I know what you mean by that but in a way scares me when you
say
> sort as in mixing up the original order they appear in which I would find
to be
> really unattractive to most.
> >>
> >
> > It's not as scary as it sounds.
> >
> > The issue is that the variables are sorted alphabetically, instead of
> > numerically.
> >
> > Let's take four words: foo1, foo2, foo10, and foo20.
> > If you sort them alphabetically, you get:
> >
> >         foo1
> >         foo10
> >         foo2
> >         foo20
> >
> > You'll notice this when doing a directory listing, as that too is
> > sorted alphabetically.
> >
> > This is why "alias14" is run before "alias8" and "alias9". Because
> > they are processed in alphabetically sorted order. I didn't do
> > anything to sort the values, they came pre-sorted in alphabetic order.
> >
> > If I simply throw in a "| sort -n", then it will change it to
numerically sorted.
> > As you might expect, numerically sorting the above list would result in:
> >
> >         foo1
> >         foo2
> >         foo10
> >         foo20
> >
> > Trivial really. I'll throw a patch at you when I get some cycles (soon).
> 
> Wouldn't "|sort -n" sort foo10 before foo2?
> 

[Devin Teske] 

Looks like what the OP wanted was "| sort -nk1.4" where the "4" is
specific to "foo" prefix (we want sort to start on the 4th character of
field 1; where the number starts).
-- 
Devin

_____________
The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?11bd01cf2f69$ba7d5040$2f77f0c0$>