Re: head or tail

From: Barry Finkel (b19141@ACHILLES.CTD.ANL.GOV)
Date: Mon Apr 14 2003 - 14:31:03 EDT


>>From: Shawn Bierman [mailto:BiermanS@METHODISTHEALTH.ORG]
>>
>>I think I've seen this here before but... if I want to remove the first
>>20 lines from a command output (first 20 lines are always the same) how
>>would I do it with head/tail. I'm sure awk or sed could do it but I
>>thought I saw a trick to do it with head/tail.
>>
>> -shawn

>You could do something like this:
>
>tail -`expr $(cat $FILE | wc -l) -20` $FILE
>
>
>However:
>
>sed 1,20d
>
>Is a little more straight forward ;-)

How about using "tail +21 $FILE"?

Equally as straight forward as "sed 1,20d"

----------------------------------------------------------------------
Barry S. Finkel
Computing and Instrumentation Solutions Division
Argonne National Laboratory Phone: +1 (630) 252-7277
9700 South Cass Avenue Facsimile:+1 (630) 252-4601
Building 222, Room D209 Internet: BSFinkel@anl.gov
Argonne, IL 60439-4828 IBMMAIL: I1004994



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:44 EDT