ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: How to read a file without the first n lines
Date Tue, 08 Apr 2003 15:44:57 GMT
On Tue, 8 Apr 2003, Jan Materne <> wrote:

> Especially if you suggestion is normal Unix-behaviour.

It is in POSIX.2 for tail, but not for head AFAIK.

In tail (from the BSD manpage):

 Numbers having a leading minus (``-'') sign or no explicit sign are
 relative to the end of the input, for example, ``-n 2'' displays the
 last two lines of the input.

Which means -n 2 and -n -2 are the same.  tail -n +2 will give you
everything except the first two lines.

Unfortunately we can't make <tailfilter lines="+2"/> do anything
different from <tailfilter lines="2"/> (setLines takes a long), so
we'll have to live with being incompatible to the command line

I just checked on my Linux system and it doesn't have something like a
negative number for head either (the "give me everything except the
last two lines" option).


View raw message