Xref: utzoo comp.sources.wanted:9806 alt.sources.wanted:85 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!usc!wuarchive!texbell!splut!jay From: jay@splut.conmicro.com (Jay "you ignorant splut!" Maynard) Newsgroups: comp.sources.wanted,alt.sources.wanted Subject: Re: Backwards cat Summary: Here's a way to do it with awk Message-ID: <-YQM4+@splut.conmicro.com> Date: 15 Dec 89 20:17:11 GMT References: <6488@lindy.Stanford.EDU> Reply-To: jay@splut.conmicro.com (Jay "you ignorant splut!" Maynard) Distribution: usa Organization: Confederate Microsystems, League City, TX Lines: 20 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. It's probably pretty simple to do in C, but here's a quick and dirty in awk I use to insure that my disks get unmounted in the reverse order of being mounted: awk '{ lines[NR] = $0 } END { for(i=NR; i>=1; i--) print lines[i]; }'