Path: utzoo!utgpu!cs.utexas.edu!sdd.hp.com!wuarchive!rex!ukma!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) Newsgroups: alt.sources.d Subject: Re: shell pipeline to reverse the order of lines. Message-ID: <1991Feb26.025903.5850@NCoast.ORG> Date: 26 Feb 91 02:59:03 GMT References: <1991Feb15.164342.4552@midway.uchicago.edu> <3*-&S|^@rpi.edu> <2166@m1.cs.man.ac.uk> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KB8JRR) Followup-To: alt.sources.d Organization: North Coast Public Access Un*x (ncoast) Lines: 26 As quoted from <2166@m1.cs.man.ac.uk> by mario@cs.man.ac.uk (Mario Wolczko): +--------------- | > In <9102151917.AA04419@wendy-fate.UU.NET> kyle@UUNET.UU.NET (Kyle Jones): | > After seeing a couple of programs in Perl and Icon to do this, I | > feel compelled to post a shell pipeline solution to this problem. | | Pass\'e solution, man. Try this: | ed - file <<\x | g/^/m0 | w | q | x +--------------- I don't understand what's wrong with nl | sort -nr | cut -f2- I use this about twice a month. Scripts? We don't need no steenking scripts! ++Brandon -- Me: Brandon S. Allbery VHF/UHF: KB8JRR on 220, 2m, 440 Internet: allbery@NCoast.ORG Packet: KB8JRR @ WA8BXN America OnLine: KB8JRR AMPR: KB8JRR.AmPR.ORG [44.70.4.88] uunet!usenet.ins.cwru.edu!ncoast!allbery Delphi: ALLBERY