bug-coreutils
[Top][All Lists]
Advanced

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

Re: Tail +N apparent error.


From: Jan-Pawel Wrozstinski
Subject: Re: Tail +N apparent error.
Date: Mon, 12 Oct 2009 01:11:34 -0700
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

   Alfred M. Szmidt wrote:

tail +n is a obsolete syntax, and was deprecate in POSIX 1003.1-2001.
>From the coreutils manual:
. . . . .
| . . . .  if you have a newer system but are running
| software that assumes an older version of POSIX and uses `sort +1' or
| `tail +10', you can work around any compatibility problems by setting
| `_POSIX2_VERSION=199209' in your environment.
  

   Eric Blake wrote:

Not a bug.  You meant:

tail -n +2 FILENAME.

To make this clearer, the latest version of tail --help outputs this
instead (which means you may want to upgrade; coreutils is now at 8.0):

  -n, --lines=K            output the last K lines, instead of the last 10;
                           or use +K to output lines starting with the Kth

By the way, this is also dependent on what version of POSIX your system
complies with.  Your default is apparently POSIX 2001, but you can select
the older behavior by manipulating the _POSIX2_VERSION environment
variable, as documented in 'info coreutils standards'.

   Thank you both for clearing up this question.
   I think that, rather than forcing my environment to conform to an obsolete
   version, I will rewrite my few scripts and aliases (and re-wire my fingers)
   to use the newer syntax.

   Incidentally,  I can't say that the newer "help" on this topic is much
   clearer -- especially for those of accustomed to the older versions -- than
   the one I currently have running. If I may, I'd like to recommend having it
   read:
or use "-n +K" to ...

   And ...  how do I go about making sure I have the latest "tail" (and the
   other core utilities) installed?  Update Manager doesn't seem to notice...

   Again, thanks.

   --
   Jan-Pawel Wrozstinski <address@hidden>

References

   1. mailto:address@hidden


reply via email to

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