Script / sort question; sort on last field of a line?
Walter Dnes
waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org
Fri May 5 00:26:53 UTC 2006
On Thu, May 04, 2006 at 09:26:02AM -0400, Lennart Sorensen wrote
> On Thu, May 04, 2006 at 01:45:32AM -0400, Walter Dnes wrote:
> > How do I sort on the last (or 2nd last or whatever) field of a line?
> >
> > One awkward possibility involves rewriting the lines backwards,
> > sorting on what is now the first field, and rewriting the lines
> > backwards a second time. I'm not aware of a utility to do write lines
> > backwards. I am *NOT* thinking of "tac" which writes the lines
> > unaltered but reverses their order. I want to write *EACH INDIVIDUAL
> > LINE* backwards. The following script does what I want...
>
> man rev
<ELVIS>
Thank you, thank you, thank you verry verry much.
</ELVIS>
I had seen Google references to a "reverse" command in some *nixes,
but couldn't find it in linux. Even after 5 years, I still occasionally
have to ask "what command do I use to...".
--
Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org> In linux /sbin/init is Job #1
My musings on technology and security at http://tech_sec.blog.ca
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list