unhead

2004-09-24 Thread Jose Alves de Castro
You're probably all familiar with the commands head and tail, which let you extract the first or the last N lines of input or a file... Imagine you want to print a file, but without the first N lines... For N=1, one possibility would be: print if $. - 1; For any N, maybe this: print if

Re: unhead

2004-09-24 Thread Josh Goldberg
Here's a little oneliner to skip the first 5 lines of the file 'foo': perl -i5 -e '@_=STDIN;[EMAIL PROTECTED]' foo On Sep 24, 2004, at 7:17 AM, Jose Alves de Castro wrote: You're probably all familiar with the commands head and tail, which let you extract the first or the last N lines of input

Re: unhead

2004-09-24 Thread Yitzchak Scott-Thoennes
On Fri, Sep 24, 2004 at 03:17:56PM +0100, Jose Alves de Castro wrote: print if ($N+1)..0; Implicit comparison to $. only happens for constants, so that should be ($. $N) .. 0

Re: unhead

2004-09-24 Thread John Douglas Porter
I think we'd like to avoid solutions that involve loading entire file into an array, agreed? Here's how I'd do it: sed -n '5,$p' -- John Douglas Porter Josh Goldberg [EMAIL PROTECTED] wrote: Here's a little oneliner to skip the first 5 lines of the file 'foo': perl -i5 -e