[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6605: +N lines broken with /usr/bin/tail (GNU coreutils) 7.4

From: Forest Oakwater
Subject: bug#6605: +N lines broken with /usr/bin/tail (GNU coreutils) 7.4
Date: Thu, 15 Jul 2010 13:34:50 -0700 (PDT)


Thank you for the information.  Would you consider updating the builtin 
documentation and man page to match the behavior of the program?

Also, do you know of an efficient POSIX way to filter out the first N lines of 
a text file?

# inefficient?
head -N datafile > datafile.head
diff datafile.head datafile |grep '^>' |cut -c3- > datafile.new
mv datafile.new datafile


--- On Mon, 7/12/10, Paul Eggert <address@hidden> wrote:

From: Paul Eggert <address@hidden>
Subject: Re: bug#6605: +N lines broken with /usr/bin/tail (GNU coreutils) 7.4
To: address@hidden
Cc: address@hidden
Date: Monday, July 12, 2010, 2:46 PM

On 07/10/10 12:53, Davide Brini wrote:

> The "tail +2" syntax is obsolete; probably the recent versions of coreutils
> (which 7.4 is not, anyway) dropped support for it.

It's not just obsolete: it's incompatible with POSIX 1003.1-2001,
which is why it was dropped a while ago.  You can bring back
support for "tail +2" by setting _POSIX2_VERSION=199209 in
your environment; this is documented in the coreutils manual.
But it's probably better to update those dusty old shell scripts
to use the POSIX-specified syntax.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]