I think you and Richard are right. Looking at the man page,
the behavior is not unexpected. I mis-read what my own
experiment did and thought sort -n actually sorted 2.1.4
and 2.1.1. I guess it's more of a 4am-on-a-sleepless-night
problem than a sort problem.
Thanks.
Greg
You probably want it to look at the rest of the line after sorting
according to the initial numeric string, like this:
cpu% cat tmp/sorttest
2
7
2.1
2.1.4
2.1.1
term% sort +0n +1 -t. -u tmp/sorttest
2
2.1
2.1.1
2.1.4
7
I think the "strangeness" you observed is consistent with what
the man page sa
hi,
doesnt it seem to be fine?
> Just noticed this
>
> cpu% cat tmp/sorttest
> 2
> 7
> 2.1
> 2.1.4
> 2.1.1
> cpu% sort tmp/sorttest
> 2
> 2.1
> 2.1.1
> 2.1.4
> 7
--> sorts the string values
> cpu% sort -u tmp/sorttest
> 2
> 2.1
> 2.1.1
> 2.1.4
> 7
--> sorts the string values and removes a
Just noticed this
cpu% cat tmp/sorttest
2
7
2.1
2.1.4
2.1.1
cpu% sort tmp/sorttest
2
2.1
2.1.1
2.1.4
7
cpu% sort -u tmp/sorttest
2
2.1
2.1.1
2.1.4
7
cpu% sort -n tmp/sorttest
2
2.1
2.1.4
2.1.1
7
cpu% sort -n -u tmp/sorttest
2
2.1
7
cpu%
Greg