HP3000-L Archives

January 2001, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"COLE,GLENN (Non-HP-SantaClara,ex2)" <[log in to unmask]>
Reply To:
COLE,GLENN (Non-HP-SantaClara,ex2)
Date:
Wed, 10 Jan 2001 14:48:56 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (29 lines)
Tony Newton writes:

> I can't remember for the life of me how to print an entire file minus the
> last 'x' lines on UX 10.20.  I played with tail for awhile but that didn't
> get me anywhere.  Any suggestions.

Incidentally, I just stumbled on what Tony may have been thinking.

It turns out that 'tail' also accepts the syntax

   tail +2 filename

vs. the more common

   tail -2 filename

The latter case displays the last two lines of filename,
while the former displays filename *beginning with* line 2
(counting from 1).

However, 'head' does not support this syntax.

Thus, while it's easy to "print an entire file minus the FIRST 'x' lines,"
it's not so easy to print minus the LAST 'x' lines.

Learn something new every day....

--Glenn

ATOM RSS1 RSS2