Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!sgi!shinobu!odin!thestepchild!rhartman From: rhartman@thestepchild.sgi.com (Robert Hartman) Newsgroups: comp.unix.questions Subject: Re: How to print last pages of a file? Message-ID: <1991May2.225750.26077@odin.corp.sgi.com> Date: 2 May 91 22:57:50 GMT References: <1991May2.162355.779@elroy.jpl.nasa.gov> Sender: news@odin.corp.sgi.com (Net News) Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 14 In article <1991May2.162355.779@elroy.jpl.nasa.gov> pjs@euclid.jpl.nasa.gov writes: >How can I print the last pages of a text file? Said file has form >feeds at random places, so "tail -132 file | lpr" won't work. Now, I tried >"pr file | tail -132" but that includes the 5-line headers and footers >that I don't want and don't get with "lpr file". So I tried >"pr -t file | tail -132" but the -t option turns off page filling so the >form feeds aren't expanded :-(. > >Any suggestions? SunOS 4.1 over here. Sounds like a job for csplit to me! Split the pr output at the ^L characters, and take the last n resulting files! -r