• behaviour of sort

    From William Unruh@2:250/1 to All on Sat Oct 24 22:44:42 2020
    I have been trying to sort the output of ipset list into IP
    I do
    ipset list sshdeny|sort -t. -n -k1,3
    Here is an example of the output
    5.199.130.188 timeout 1320573
    5.2.188.23 timeout 1320572
    5.2.72.101 timeout 1320572
    5.2.72.110 timeout 1320572
    5.2.72.113 timeout 1320572
    5.2.77.146 timeout 1320572
    5.2.77.22 timeout 1320573
    5.2.77.63 timeout 1320573

    While the first octet are sorted into numerical order, the second and
    third are not. As a number 2 is less than 199. 188 is greater than 72.



    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Bit Twister@2:250/1 to All on Sat Oct 24 23:02:18 2020
    On Sat, 24 Oct 2020 21:44:42 -0000 (UTC), William Unruh wrote:
    I have been trying to sort the output of ipset list into IP
    I do
    ipset list sshdeny|sort -t. -n -k1,3
    Here is an example of the output
    5.199.130.188 timeout 1320573
    5.2.188.23 timeout 1320572
    5.2.72.101 timeout 1320572
    5.2.72.110 timeout 1320572
    5.2.72.113 timeout 1320572
    5.2.77.146 timeout 1320572
    5.2.77.22 timeout 1320573
    5.2.77.63 timeout 1320573

    While the first octet are sorted into numerical order, the second and
    third are not. As a number 2 is less than 199. 188 is greater than 72.

    For these kinds of sorts, I prefer version sorting
    sort --version-sort --key=1 a
    5.2.72.101 timeout 1320572
    5.2.72.110 timeout 1320572
    5.2.72.113 timeout 1320572
    5.2.77.22 timeout 1320573
    5.2.77.63 timeout 1320573
    5.2.77.146 timeout 1320572
    5.2.188.23 timeout 1320572
    5.199.130.188 timeout 1320573


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Sat Oct 24 23:41:20 2020
    On 2020-10-24, Bit Twister <BitTwister@mouse-potato.com> wrote:
    On Sat, 24 Oct 2020 21:44:42 -0000 (UTC), William Unruh wrote:
    I have been trying to sort the output of ipset list into IP
    I do
    ipset list sshdeny|sort -t. -n -k1,3
    Here is an example of the output
    5.199.130.188 timeout 1320573
    5.2.188.23 timeout 1320572
    5.2.72.101 timeout 1320572
    5.2.72.110 timeout 1320572
    5.2.72.113 timeout 1320572
    5.2.77.146 timeout 1320572
    5.2.77.22 timeout 1320573
    5.2.77.63 timeout 1320573

    While the first octet are sorted into numerical order, the second and
    third are not. As a number 2 is less than 199. 188 is greater than 72.

    For these kinds of sorts, I prefer version sorting

    Thanks. Yes sort -V -k1,1 works great.

    sort --version-sort --key=1 a
    5.2.72.101 timeout 1320572
    5.2.72.110 timeout 1320572
    5.2.72.113 timeout 1320572
    5.2.77.22 timeout 1320573
    5.2.77.63 timeout 1320573
    5.2.77.146 timeout 1320572
    5.2.188.23 timeout 1320572
    5.199.130.188 timeout 1320573


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Jim Beard@2:250/1 to All on Sun Oct 25 13:40:29 2020
    On Sat, 24 Oct 2020 22:41:20 +0000, William Unruh wrote:

    On 2020-10-24, Bit Twister <BitTwister@mouse-potato.com> wrote:
    On Sat, 24 Oct 2020 21:44:42 -0000 (UTC), William Unruh wrote:

    I have been trying to sort the output of ipset list into IP
    I do
    ipset list sshdeny|sort -t. -n -k1,3
    Here is an example of the output
    5.199.130.188 timeout 1320573
    5.2.188.23 timeout 1320572
    5.2.72.101 timeout 1320572
    5.2.72.110 timeout 1320572
    5.2.72.113 timeout 1320572
    5.2.77.146 timeout 1320572
    5.2.77.22 timeout 1320573
    5.2.77.63 timeout 1320573

    While the first octet are sorted into numerical order, the second and
    third are not. As a number 2 is less than 199. 188 is greater than 72.

    For these kinds of sorts, I prefer version sorting

    Thanks. Yes sort -V -k1,1 works great.

    sort --version-sort --key=1 a
    5.2.72.101 timeout 1320572
    5.2.72.110 timeout 1320572
    5.2.72.113 timeout 1320572
    5.2.77.22 timeout 1320573
    5.2.77.63 timeout 1320573
    5.2.77.146 timeout 1320572
    5.2.188.23 timeout 1320572
    5.199.130.188 timeout 1320573

    You still have 5.199.130... at the bottom of the list, rather than
    the top.

    Use the command sort -t. -g -k1,3 or
    sort --version-sort -g --key=1 a
    to get 5.199... at the top of the list.

    Cheers!

    jim b.

    --
    UNIX is not user-unfriendly, it merely
    expects users to be computer friendly.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Sun Oct 25 16:28:00 2020
    On 2020-10-25, Jim Beard <jim.beard@verizon.net> wrote:
    On Sat, 24 Oct 2020 22:41:20 +0000, William Unruh wrote:

    On 2020-10-24, Bit Twister <BitTwister@mouse-potato.com> wrote:
    On Sat, 24 Oct 2020 21:44:42 -0000 (UTC), William Unruh wrote:

    I have been trying to sort the output of ipset list into IP
    I do
    ipset list sshdeny|sort -t. -n -k1,3
    Here is an example of the output
    5.199.130.188 timeout 1320573
    5.2.188.23 timeout 1320572
    5.2.72.101 timeout 1320572
    5.2.72.110 timeout 1320572
    5.2.72.113 timeout 1320572
    5.2.77.146 timeout 1320572
    5.2.77.22 timeout 1320573
    5.2.77.63 timeout 1320573

    While the first octet are sorted into numerical order, the second and
    third are not. As a number 2 is less than 199. 188 is greater than 72.

    For these kinds of sorts, I prefer version sorting

    Thanks. Yes sort -V -k1,1 works great.

    sort --version-sort --key=1 a
    5.2.72.101 timeout 1320572
    5.2.72.110 timeout 1320572
    5.2.72.113 timeout 1320572
    5.2.77.22 timeout 1320573
    5.2.77.63 timeout 1320573
    5.2.77.146 timeout 1320572
    5.2.188.23 timeout 1320572
    5.199.130.188 timeout 1320573

    You still have 5.199.130... at the bottom of the list, rather than
    the top.

    Use the command sort -t. -g -k1,3 or
    sort --version-sort -g --key=1 a
    to get 5.199... at the top of the list.

    Why would I want 5.199 at the top of the list? The octet 199 is much
    larger than 2 (binary 00000010 vs 11000111) 199 vs 2 would not be
    numeric sort, unless you interpreted the period as a decimal point,
    which it is not. So, it would probably be best to think about the number
    in European convention, where . acts like the american , in a number.
    -n -t. -k1,3 would treat the that first . as a decimal, and does not work
    for sorting IP numbers. -n -t. -k1,1 -k2,2 -k3,3 does work, but does
    not handle the last one properly, since -k4 would include the whole line
    (eg "188 timeout 1320573"
    I am not at all sure what -g does. What is a "general numeric"?




    Cheers!

    jim b.


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From ray carter@2:250/1 to All on Sun Oct 25 22:42:31 2020
    On Sat, 24 Oct 2020 21:44:42 +0000, William Unruh wrote:

    I have been trying to sort the output of ipset list into IP I do ipset
    list sshdeny|sort -t. -n -k1,3 Here is an example of the output
    5.199.130.188 timeout 1320573 5.2.188.23 timeout 1320572 5.2.72.101
    timeout 1320572 5.2.72.110 timeout 1320572 5.2.72.113 timeout 1320572 5.2.77.146 timeout 1320572 5.2.77.22 timeout 1320573 5.2.77.63 timeout 1320573

    While the first octet are sorted into numerical order, the second and
    third are not. As a number 2 is less than 199. 188 is greater than 72.

    I believe sort has swith to sort my numerical order rather than by alpha
    sort. 199 < 2 by alpha sort.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1@fidonet)
  • From Jim Beard@2:250/1 to All on Sun Oct 25 23:54:39 2020
    On Sun, 25 Oct 2020 16:28:00 +0000, William Unruh wrote:

    On 2020-10-25, Jim Beard <jim.beard@verizon.net> wrote:
    On Sat, 24 Oct 2020 22:41:20 +0000, William Unruh wrote:

    On 2020-10-24, Bit Twister <BitTwister@mouse-potato.com> wrote:
    On Sat, 24 Oct 2020 21:44:42 -0000 (UTC), William Unruh wrote:

    I have been trying to sort the output of ipset list into IP I do
    ipset list sshdeny|sort -t. -n -k1,3 Here is an example of the output
    5.199.130.188 timeout 1320573 5.2.188.23 timeout 1320572 5.2.72.101
    timeout 1320572 5.2.72.110 timeout 1320572 5.2.72.113 timeout 1320572
    5.2.77.146 timeout 1320572 5.2.77.22 timeout 1320573 5.2.77.63
    timeout 1320573

    While the first octet are sorted into numerical order, the second and
    third are not. As a number 2 is less than 199. 188 is greater than
    72.

    For these kinds of sorts, I prefer version sorting

    Thanks. Yes sort -V -k1,1 works great.

    sort --version-sort --key=1 a
    5.2.72.101 timeout 1320572 5.2.72.110 timeout 1320572 5.2.72.113
    timeout 1320572 5.2.77.22 timeout 1320573 5.2.77.63 timeout 1320573
    5.2.77.146 timeout 1320572 5.2.188.23 timeout 1320572 5.199.130.188
    timeout 1320573

    You still have 5.199.130... at the bottom of the list, rather than the
    top.

    Use the command sort -t. -g -k1,3 or sort --version-sort -g --key=1 a
    to get 5.199... at the top of the list.

    Why would I want 5.199 at the top of the list? The octet 199 is much
    larger than 2 (binary 00000010 vs 11000111) 199 vs 2 would not be
    numeric sort, unless you interpreted the period as a decimal point,
    which it is not. So, it would probably be best to think about the number
    in European convention, where . acts like the american , in a number.
    -n -t. -k1,3 would treat the that first . as a decimal, and does not
    work for sorting IP numbers. -n -t. -k1,1 -k2,2 -k3,3 does work, but
    does not handle the last one properly, since -k4 would include the whole
    line (eg "188 timeout 1320573"
    I am not at all sure what -g does. What is a "general numeric"?

    I did look at the . - . entries as group entries, with 1* preceding 2*.
    Your preference definitely does put 5.2. ahead of 5.199.

    I do not have the foggiest idea what the definition of a "general
    numeric" is, but it is an alternative to both alpha and numeric,
    that once in a while does something I prefer.

    Cheers!

    jim b.

    --
    UNIX is not user-unfriendly, it merely
    expects users to be computer friendly.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Mon Oct 26 03:34:54 2020
    On 2020-10-25, Jim Beard <jim.beard@verizon.net> wrote:
    On Sun, 25 Oct 2020 16:28:00 +0000, William Unruh wrote:

    On 2020-10-25, Jim Beard <jim.beard@verizon.net> wrote:
    On Sat, 24 Oct 2020 22:41:20 +0000, William Unruh wrote:

    On 2020-10-24, Bit Twister <BitTwister@mouse-potato.com> wrote:
    On Sat, 24 Oct 2020 21:44:42 -0000 (UTC), William Unruh wrote:

    I have been trying to sort the output of ipset list into IP I do
    ipset list sshdeny|sort -t. -n -k1,3 Here is an example of the output >>>>> 5.199.130.188 timeout 1320573 5.2.188.23 timeout 1320572 5.2.72.101
    timeout 1320572 5.2.72.110 timeout 1320572 5.2.72.113 timeout 1320572 >>>>> 5.2.77.146 timeout 1320572 5.2.77.22 timeout 1320573 5.2.77.63
    timeout 1320573

    While the first octet are sorted into numerical order, the second and >>>>> third are not. As a number 2 is less than 199. 188 is greater than
    72.

    For these kinds of sorts, I prefer version sorting

    Thanks. Yes sort -V -k1,1 works great.

    sort --version-sort --key=1 a
    5.2.72.101 timeout 1320572 5.2.72.110 timeout 1320572 5.2.72.113
    timeout 1320572 5.2.77.22 timeout 1320573 5.2.77.63 timeout 1320573
    5.2.77.146 timeout 1320572 5.2.188.23 timeout 1320572 5.199.130.188
    timeout 1320573

    You still have 5.199.130... at the bottom of the list, rather than the
    top.

    Use the command sort -t. -g -k1,3 or sort --version-sort -g --key=1 a
    to get 5.199... at the top of the list.

    Why would I want 5.199 at the top of the list? The octet 199 is much
    larger than 2 (binary 00000010 vs 11000111) 199 vs 2 would not be
    numeric sort, unless you interpreted the period as a decimal point,
    which it is not. So, it would probably be best to think about the number
    in European convention, where . acts like the american , in a number.
    -n -t. -k1,3 would treat the that first . as a decimal, and does not
    work for sorting IP numbers. -n -t. -k1,1 -k2,2 -k3,3 does work, but
    does not handle the last one properly, since -k4 would include the whole
    line (eg "188 timeout 1320573"
    I am not at all sure what -g does. What is a "general numeric"?

    I did look at the . - . entries as group entries, with 1* preceding 2*.
    Your preference definitely does put 5.2. ahead of 5.199.

    I do not have the foggiest idea what the definition of a "general
    numeric" is, but it is an alternative to both alpha and numeric,
    that once in a while does something I prefer.

    Going onto google, it will place 1.753e01 ahead of 1.63e00
    Ie, it is a numeric sort which interprets floats properly.

    But -n interprets 7.199 ahead of 7.2 (which I sure do not want since
    that is hardly true of IP addresses.)Ie, it interprets the . as a
    decimal point. Thus you need something like
    -n -t. -k1,1 -k2,2 -k3,3
    Ie, each of the terms separated by a . are interpreted as numbers.
    -m -t. -k1,3 would interpret the whole of the number 2.199.75.46 timout
    79443
    as first sorting the whole of 2 199 75 as a number, (not sure what it
    does with the blanks)
    while -n -t. -k1,1 -k2,2 -k3,3
    sorts the first number, 2 first then if that is ambiguous, sorts
    according to 199 ane then if those two are ambiguous, according to 75.
    -V -k1,3 interprets 2.199.75 as a version number where 75 is the
    sub-minor version, 199 is the minor version and 2 is the major version.
    Ie, it is the same as -n -t. -k1,1 -k2,2 -k3,3




    Cheers!

    jim b.


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From santo@2:250/1 to All on Mon Oct 26 14:28:23 2020
    On Mon, 26 Oct 2020 03:34:54 +0000, William Unruh wrote:


    But -n interprets 7.199 ahead of 7.2 (which I sure do not want since
    that is hardly true of IP addresses.)Ie, it interprets the . as a
    decimal point. Thus you need something like
    -n -t. -k1,1 -k2,2 -k3,3
    Ie, each of the terms separated by a . are interpreted as numbers.
    -m -t. -k1,3 would interpret the whole of the number 2.199.75.46 timout 79443
    as first sorting the whole of 2 199 75 as a number, (not sure what it
    does with the blanks)
    while -n -t. -k1,1 -k2,2 -k3,3
    sorts the first number, 2 first then if that is ambiguous, sorts
    according to 199 ane then if those two are ambiguous, according to 75.
    -V -k1,3 interprets 2.199.75 as a version number where 75 is the
    sub-minor version, 199 is the minor version and 2 is the major version.
    Ie, it is the same as -n -t. -k1,1 -k2,2 -k3,3




    Cheers!

    jim b.


    ?????

    what on earth are you guys talking about? is it still Linux ...Mageia or...etc...??
    :-D
    :-D
    :-D

    Sorry could not help it...I regularly check this group
    but sometimes I really wonder ... disregard this post,
    I am in a good mood and - in my ignorance - this tread really
    made me laugh...
    :-)



    --
    Running Mageia release 7 (Official) for x86_64 using Kernel=5.7.19-desktop-1.mga7 on x86_64 DM=sddm DE= ST=tty
    Card:ATI Radeon HD 5000 to HD 6300 (radeon/fglrx): Advanced Micro Devices, Inc.
    [AMD/ATI]|Kabini [Radeon HD 8400 / R3 Series] [DISPLAY_VGA]

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Aioe.org NNTP Server (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Mon Oct 26 15:30:56 2020
    On 2020-10-26, santo <santo@auroville.org.in> wrote:
    On Mon, 26 Oct 2020 03:34:54 +0000, William Unruh wrote:


    But -n interprets 7.199 ahead of 7.2 (which I sure do not want since
    that is hardly true of IP addresses.)Ie, it interprets the . as a
    decimal point. Thus you need something like
    -n -t. -k1,1 -k2,2 -k3,3
    Ie, each of the terms separated by a . are interpreted as numbers.
    -m -t. -k1,3 would interpret the whole of the number 2.199.75.46 timout
    79443
    as first sorting the whole of 2 199 75 as a number, (not sure what it
    does with the blanks)
    while -n -t. -k1,1 -k2,2 -k3,3
    sorts the first number, 2 first then if that is ambiguous, sorts
    according to 199 ane then if those two are ambiguous, according to 75.
    -V -k1,3 interprets 2.199.75 as a version number where 75 is the
    sub-minor version, 199 is the minor version and 2 is the major version.
    Ie, it is the same as -n -t. -k1,1 -k2,2 -k3,3




    what on earth are you guys talking about? is it still Linux ...Mageia
    or...etc...??

    Yes, it is Linux. The behaviour of the command "sort" in Linux (a
    command in the long list of Unix/Linux commands for sorting a list) , and its various arguments.
    In particular:
    a) what is the meaning of the -g flag -- which the man page says is
    generalised number.
    b) How does one get the command to order a list of IPv4 addresses into
    the right (IPv4) order.


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Chris Elvidge@2:250/1 to All on Mon Oct 26 16:23:15 2020
    On 26/10/2020 03:30 pm, William Unruh wrote:
    On 2020-10-26, santo <santo@auroville.org.in> wrote:
    On Mon, 26 Oct 2020 03:34:54 +0000, William Unruh wrote:


    But -n interprets 7.199 ahead of 7.2 (which I sure do not want since
    that is hardly true of IP addresses.)Ie, it interprets the . as a
    decimal point. Thus you need something like
    -n -t. -k1,1 -k2,2 -k3,3
    Ie, each of the terms separated by a . are interpreted as numbers.
    -m -t. -k1,3 would interpret the whole of the number 2.199.75.46 timout >>> 79443
    as first sorting the whole of 2 199 75 as a number, (not sure what it
    does with the blanks)
    while -n -t. -k1,1 -k2,2 -k3,3
    sorts the first number, 2 first then if that is ambiguous, sorts
    according to 199 ane then if those two are ambiguous, according to 75.
    -V -k1,3 interprets 2.199.75 as a version number where 75 is the
    sub-minor version, 199 is the minor version and 2 is the major version.
    Ie, it is the same as -n -t. -k1,1 -k2,2 -k3,3




    what on earth are you guys talking about? is it still Linux ...Mageia or...etc...??

    Yes, it is Linux. The behaviour of the command "sort" in Linux (a
    command in the long list of Unix/Linux commands for sorting a list) , and
    its
    various arguments.
    In particular:
    a) what is the meaning of the -g flag -- which the man page says is generalised number.
    b) How does one get the command to order a list of IPv4 addresses into
    the right (IPv4) order.


    b) Assuming the IP addresses are at the start of the lines, sort -V will
    work (as stated upthread). If the IP addresses are in the second field
    add -k2



    --

    Chris Elvidge, England

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Spiros Bousbouras@2:250/1 to All on Sat Nov 7 12:18:28 2020
    On Mon, 26 Oct 2020 03:34:54 -0000 (UTC)
    William Unruh <unruh@invalid.ca> wrote:
    Thus you need something like
    -n -t. -k1,1 -k2,2 -k3,3
    Ie, each of the terms separated by a . are interpreted as numbers.
    -m -t. -k1,3 would interpret the whole of the number
    ^
    I think you mean -n

    2.199.75.46 timout 79443
    as first sorting the whole of 2 199 75 as a number, (not sure what it
    does with the blanks)

    I think it tries to interpret 2.199.75 as a number. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sort.html :

    -t char
    Use char as the field separator character; char shall not be
    considered to be part of a field (although it can be included
    in a sort key).

    I.e. , if I'm understanding the above correctly , it won't replace the separator by blanks when doing the comparison. So when using the -n
    option , the locale may also play a part because in some locales the
    dot is used as thousands separator.

    while -n -t. -k1,1 -k2,2 -k3,3
    sorts the first number, 2 first then if that is ambiguous, sorts
    according to 199 ane then if those two are ambiguous, according to 75.
    -V -k1,3 interprets 2.199.75 as a version number where 75 is the
    sub-minor version, 199 is the minor version and 2 is the major version.
    Ie, it is the same as -n -t. -k1,1 -k2,2 -k3,3

    But -n -t. -k1,1 -k2,2 -k3,3 is more portable because -V is not in
    the POSIX standard.

    By the way , a better group for such questions is comp.unix.shell .

    --
    Which do I prefer? Sex or chess? It depends on the position.
    Boris Spassky

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: virginmedia.com (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Sat Nov 7 18:04:07 2020
    On 2020-11-07, Spiros Bousbouras <spibou@gmail.com> wrote:
    On Mon, 26 Oct 2020 03:34:54 -0000 (UTC)
    William Unruh <unruh@invalid.ca> wrote:
    Thus you need something like
    -n -t. -k1,1 -k2,2 -k3,3
    Ie, each of the terms separated by a . are interpreted as numbers.
    -m -t. -k1,3 would interpret the whole of the number
    ^
    I think you mean -n
    Yes.


    2.199.75.46 timout 79443
    as first sorting the whole of 2 199 75 as a number, (not sure what it
    does with the blanks)

    I think it tries to interpret 2.199.75 as a number. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sort.html :

    -t char
    Use char as the field separator character; char shall not be
    considered to be part of a field (although it can be included
    in a sort key).

    This sentence is so ambiguous that it makes no sense.

    I.e. , if I'm understanding the above correctly , it won't replace the separator by blanks when doing the comparison . So when using the -n
    option , the locale may also play a part because in some locales the
    dot is used as thousands separator.

    They should not be blanks. In defining the fields, the separator is
    removed 2.199.75 sorted with -t. would produce the three fields 2, 199,
    But I just tried
    echo 'a a
    a b
    a b
    a c
    a d
    a a'|sort -t.
    and got
    a a
    a a
    a b
    a b
    a c
    a d
    so blank is not regarded as a character, or a a and a b should be
    together. So sort really is broken in the way it treats separators.



    while -n -t. -k1,1 -k2,2 -k3,3
    sorts the first number, 2 first then if that is ambiguous, sorts
    according to 199 ane then if those two are ambiguous, according to 75.
    -V -k1,3 interprets 2.199.75 as a version number where 75 is the
    sub-minor version, 199 is the minor version and 2 is the major version.
    Ie, it is the same as -n -t. -k1,1 -k2,2 -k3,3

    But -n -t. -k1,1 -k2,2 -k3,3 is more portable because -V is not in
    the POSIX standard.

    By the way , a better group for such questions is comp.unix.shell .


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)