Path: utzoo!utgpu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!funic!santra!nntp!iisakkil From: iisakkil@niksula.hut.fi (Mika R Iisakkila) Newsgroups: alt.sources.d Subject: Re: shell pipeline to reverse the order of lines. Message-ID: Date: 2 Mar 91 13:12:43 GMT References: <2166@m1.cs.man.ac.uk> <1991Feb26.025903.5850@NCoast.ORG> <1991Feb27.010612.25618@agate.berkeley.edu> <1991Feb28.134628.14432@druid.uucp> Sender: news@santra.uucp (Cnews - USENET news system) Organization: Otaniemi Underground Broadcasting System Lines: 10 In-Reply-To: darcy@druid.uucp's message of 28 Feb 91 13:46:28 GMT Since this will probably be a never-ending thread, I'll post the most pervert way I could think of doing the deed: awk 'BEGIN{l=10000;}{printf("%d %s\n",l++,$0);}' | sort -r | colrm 1 6 Replace 'colrm 1 6' with 'cut -c7-' if you're on System V. Slight modifications required, if the file is large (what's the limit for scalar values in awk? Or does sort die first?). Hope that someone finds this at least marginally amusing...