[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug report : tail
Re: bug report : tail
Fri, 17 Nov 2006 10:03:43 -0700
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:18.104.22.168) Gecko/20061025 Thunderbird/22.214.171.124 Mnenhy/0.7.4.666
-----BEGIN PGP SIGNED MESSAGE-----
According to Mark McKenzie on 11/17/2006 9:11 AM:
> Using tail from
> Arch : i386
> Version: 5.97
Try upgrading; the latest stable version of coreutils is 6.4.
> tail +NUM
> no longer works
> tail -n +NUM
> does work
Read the NEWS file:
A few usages still have behavior that depends on which POSIX standard is
being conformed to, and portable applications should beware these
problematic usages. These include:
Problematic Standard-conforming replacement, depending on
usage whether you prefer the behavior of:
POSIX 1003.2-1992 POSIX 1003.1-2001
tail +4 tail -n +4 tail ./+4
Also read the documentation:
info coreutils Standards
which tells how you can set _POSIX2_VERSION in your environment to get the
older behavior. And read:
info coreutils tail:
Scripts intended for use on standard hosts should avoid obsolete
syntax and should use `-c COUNT[b]', `-n COUNT', and/or `-f' instead.
If your script must also run on hosts that support only the obsolete
syntax, you can often rewrite it to avoid problematic usages, e.g., by
using `sed -n '$p'' rather than `tail -1'. If that's not possible, the
script can use a test like `if tail -c +1 </dev/null >/dev/null 2>&1;
then ...' to decide which syntax to use.
Even if your script assumes the standard behavior, you should still
beware usages whose behaviors differ depending on the POSIX version.
For example, avoid `tail - main.c', since it might be interpreted as
either `tail main.c' or as `tail -- - main.c'; avoid `tail -c 4', since
it might mean either `tail -c4' or `tail -c 10 4'; and avoid `tail +4',
since it might mean either `tail ./+4' or `tail -n +4'.
Life is short - so eat dessert first!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----