[X-Unix] Remove last ten lines of files

Kuestner, Bjoern Bjoern.Kuestner at drkw.com
Fri Jan 2 05:18:50 PST 2004


>#! /bin/sh
>
>i=`grep -c $ $*`
>j=`expr $i - 10`
>if [ $j -lt 1 ]; then
>j=$i
>fi
>head -n $j $*

Kino, works without a hinch on first try.

Thanks!

Björn


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




--------------------------------------------------------------------------------
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