[Top][All Lists]

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

Re: Bug in tail 5.96 - "+" argument not recognized

From: Eric Blake
Subject: Re: Bug in tail 5.96 - "+" argument not recognized
Date: Wed, 12 Jul 2006 01:42:16 +0000

> Tail version 5.96 (as supplied in Fedora Core 5) has a bug where it
> does not recognize "+" as a command-line argument:

The latest stable coreutils is 5.97; you may want to consider upgrading
(although it will not change the behavior you reported)

>        $ tail +4 /etc/hosts
>        tail: cannot open `+4' for reading: No such file or directory
> This does not comply with the supplied man-page:
>        If the first character of N (the number of bytes or lines)  is  a  '+',
>        print  beginning  with the Nth item from the start of each file, other-
>        wise, print the last N items in the file.  N may have a multiplier suf-
>        fix: b 512, k 1024, m 1024*1024.

Thanks for the report.  However, the man page (and also tail --help) are
trying to tell you that "tail -n+4" is the same as "tail -n4", not necessarily
the same as "tail +4".  Also, read up in the NEWS, ever since 5.90:

 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
   sort +4           sort -k 5            sort ./+4
   tail +4           tail -n +4           tail ./+4
   tail - f          tail f               [see (*) below]
   tail -c 4         tail -c 10 ./4       tail -c4
   touch 12312359 f  touch -t 12312359 f  touch ./12312359 f
   uniq +4           uniq -s 4            uniq ./+4

   (*) "tail - f" does not conform to POSIX 1003.1-2001; to read
   standard input and then "f", use the command "tail -- - f".

Or you can read 'info coreutils standards', which talks about
setting _POSIX2_VERSION to choose what behavior of tail
you prefer.

Eric Blake

reply via email to

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