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:
"Newton, Tony" <[log in to unmask]>
Reply To:
Newton, Tony
Date:
Wed, 10 Jan 2001 15:04:11 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (64 lines)
Thanx Glenn,

As it turned out I had started reading through all the Unix commands in one
of my Unix manuals.  I had found the 'sed' command and had JUST figured out
how to use it to do what I wanted when I read your email.  I planned on
using "sed '$d' filename > newfilename".  I sure wish that I could have used
head or tail.  It just seems like something that they should do.  Oh, well.
Thanx for the assistance.
___
Tony Newton



> -----Original Message-----
> From: COLE,GLENN (Non-HP-SantaClara,ex2)
> [mailto:[log in to unmask]]
> Sent: Wednesday, January 10, 2001 2:49 PM
> To: 'Newton, Tony'; [log in to unmask]
> Subject: RE: [HP3000-L] Tailing a file.... sort of.
>
>
> 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
>

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.

ATOM RSS1 RSS2