[Top][All Lists]

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

Re: bug report : tail

From: Eric Blake
Subject: Re: bug report : tail
Date: Fri, 17 Nov 2006 10:03:43 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20061025 Thunderbird/ Mnenhy/

Hash: SHA1

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
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


reply via email to

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