[X-Unix] Remove last ten lines of files

Kuestner, Bjoern Bjoern.Kuestner at drkw.com
Fri Jan 2 04:57:07 PST 2004


Hi Stroller,

>I'm pretty sure this can be done using `sed`, but my research his 
>morning indicates it's tricky. 

Thanks just for that.

I did feel a little silly when the task was so easily described, and the
tools that come with any *nix-type OS are typically ideal for such file
manipulation, but I could not come up with anything that I would consider
elegant.

>      #!/usr/bin/sed -nf
>      1! {; H; g; }
>      1,10 !s/[^\n]*\n//
>      $p
>      h

I will look into this. These few lines use more of sed than I ever have. So
that will take a while.

>The full page is available here 
><http://www.delorie.com/gnu/docs/sed/sed_26.html> - you may find the 
>2nd example useful, also.

Thanks. Bookmarked this one immediately.

>My question is: do you REALLY want to do this..? 

Yes. Thanks for your considerations. But it's my personal e-mail going out,
nobody else's and it's also for just one recipient. So the deals of
communication are one-on-one and very clear and not as complicated as you
rightfully commented that they might be. It's just for technical reasons
that are beyond my control why such a setup is desirable.

On the other side I hope to learn a couple of things along the way of doing
this. (Which has already happened. (c:)

Bjorn


========================================================


--------------------------------------------------------------------------------
The information contained herein is confidential and is intended solely for the
addressee. Access by any other party is unauthorised without the express
written permission of the sender. If you are not the intended recipient, please
contact the sender either via the company switchboard on +44 (0)20 7623 8000, or
via e-mail return. If you have received this e-mail in error or wish to read our
e-mail disclaimer statement and monitoring policy, please refer to 
http://www.drkw.com/disc/email/ or contact the sender.
--------------------------------------------------------------------------------



More information about the X-Unix mailing list