On Wed, 20 Nov 2024, Russell Senior wrote:

... I learned about sort -V in GNU coreutils. I am responsible for the
-g option from back in the 1990s, but after beating my head against a
wall to sort on a three segment version number enough to actually
read-the-fine-manual, I happened across the -V option to sort on
version numbers, which did exactly what I needed.

Just thought I'd share my delight.

I wrote a little howto about using sort prior to coreutils 7.0 (when -V was introduced) to deal with IPv4 addresses. It was online for a couple years before someone told me about -V, which makes that operation so, so much easier:

sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4

becomes

sort -V

--
Paul Heinlein
[email protected]
45°22'48" N, 122°35'36" W

Reply via email to