Is it possible to sort a key field right to left

Arthur Chance freebsd at qeng-ho.org
Thu Sep 14 15:09:49 UTC 2017


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).


More information about the freebsd-questions mailing list