Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Sep 2017 16:09:38 +0100
From:      Arthur Chance <freebsd@qeng-ho.org>
To:        Ernie Luzar <luzar722@gmail.com>, "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: Is it possible to sort a key field right to left
Message-ID:  <575efb73-35e2-bd8c-4c9b-54c30e419686@qeng-ho.org>
In-Reply-To: <59BA9B3C.5010106@gmail.com>
References:  <59BA9B3C.5010106@gmail.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On 14/09/2017 16:07, Ernie Luzar wrote:
> I have a file containing a list of host domain names known to contain
> viruses.
> 
> I want to sort the host names from right to left so they are grouped
> together by like host name suffixes.
> 
> Is this possible?

Try this to see if it does what you want.

<infile rev | sort | rev >outfile

-- 
An amusing coincidence: log2(58) = 5.858 (to 0.0003% accuracy).



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?575efb73-35e2-bd8c-4c9b-54c30e419686>