bug-coreutils
[Top][All Lists]
Advanced

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

Re: mktexpk: non-POSIX compliant use of "tail"


From: Paul Eggert
Subject: Re: mktexpk: non-POSIX compliant use of "tail"
Date: Wed, 30 Mar 2005 13:42:24 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

address@hidden (Karl Berry) writes:

> tail -1 works for me with coreutils 5.3.0.

Whether that works depends on (1) _POSIX2_VERSION in the environment,
(2) explicit configuration options by the installer, and (3)
_POSIX2_VERSION in <unistd.h>, in descending order of importance.
On my coreutils 5.3.0 installation, it doesn't work, because I
have _POSIX2_VERSION=200112 in my environment.

A simple portable equivalent to "tail -1" is "sed -n '$p'".

>     I wonder if dropping this kind of compatibility with old UNIX
>     systems is done for a good reason.
>
> Don't get me started!  (I have complained about precisely these
> backward-incompatibilities in POSIX many times, to zero effect.)

(You weren't persistent enough.  :-)

I was part of a looonng discussion about this with the POSIX committee
last year, and it appears that a compromise will appear in the next
version of the standard.  This compromise will allow (but will not
require) implementations to support "tail -1".  However, it's more
complicated than simply saying "implementations can support the old
standard"; for example, the compromise would still prohibit support
for the old "tail -c" usage.

The compromise is still in draft form; for the latest status see
<http://www.opengroup.org/austin/docs/austin_239.html> and look for
"tail".  Since it's not final and will require a bit of nontrivial
analysis to implement, I haven't made it high priority to look at the
issue.  Also, I haven't asked Jim for his opinion about whether this
is worth doing (as the compromise doesn't require already-conforming
implementers to do anything).  Personally I have mixed feelings about
the compromise, but it will allow better backward compatibility.

It's worth emphasizing that this compromise wouldn't affect portable
POSIX applications, as they still won't be able to rely on "tail -1".
So mktexpk should be changed to avoid "tail -1" anyway.




reply via email to

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