Xref: utzoo comp.sources.wanted:9807 alt.sources.wanted:86 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!mstar!mstar.MorningStar.Com!karl From: karl@MorningStar.Com (Karl Fox) Newsgroups: comp.sources.wanted,alt.sources.wanted Subject: Re: Backwards cat Message-ID: Date: 15 Dec 89 19:35:04 GMT References: <6488@lindy.Stanford.EDU> Sender: news@MorningStar.COM (USENET Administrator) Reply-To: karl@MorningStar.Com (Karl Fox) Distribution: usa Organization: Morning Star Technologies Lines: 13 In-reply-to: odin@ucscb.UCSC.EDU's message of 15 Dec 89 08:12:20 GMT In article <6488@lindy.Stanford.EDU> odin@ucscb.UCSC.EDU (Jon Granrose) writes: I am looking for a program that will cat a file backwards. Not with all the letters reversed but one that prints the last line, then the second to last line, 3 from the last line, etc.) If it doesn't exist then I will write my own but I thought I'd ask first. Try this: #!/bin/sh grep -n "^" $* | sort -rn -t: | cut -d: -f2- -- Karl Fox, Morning Star Technologies karl@MorningStar.COM