tail does not work with '+' short option

Bug #241555 reported by Paolo Melacarne
4
Affects Status Importance Assigned to Milestone
coreutils
Unknown
Unknown
coreutils (Debian)
Fix Released
Unknown
coreutils (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: coreutils

Version: coreutils 6.10-3ubuntu2 (hardy)

Self explanatory transcript follows.

shell prompt> tail +50 fname1 > fname2
tail: cannot open `+50' for reading: no such file or directory
...
shell prompt> tail --lines=+50 fname1 > fname2

[OK]

Tags: tail
Changed in coreutils:
status: Unknown → New
Revision history for this message
JM Williams (jmdwilliams) wrote :

Confirming (coreutils 6.10-3ubuntu2 also).

However, this is by design, to comply with POSIX, as explained in GNU coreutils FAQ nº 33: Old tail plus N syntax now fails:
http://www.gnu.org/software/coreutils/faq/#Old-tail-plus-N-syntax-now-fails

Whether +N represents a file or a line reference apparently depends on which POSIX version is followed: 1003.2-1992 or 1003.1-2001.

The man page lists only the now-recommended syntaxes: -n, --lines=N. The info documentation, however, explains that, “For compatibility ‘tail’ also supports an obsolete usage ‘tail -[COUNT][bcl][f] [FILE]….’ The info documentation (and, quoting it, the above FAQ) also explains that the +N notation can be enabled (for tail, “sort, uniq, touch and perhaps other programs”) by exporting the setting _POSIX2_VERSION=199209.

There is a bug report for this in the Debian bug tracker (nº 471264) and a (Closed Invalid) one in the GNU bug tracker (nº 21549).

Revision history for this message
JM Williams (jmdwilliams) wrote :

Instead, marking as Invalid rather than Confirmed because “the report describes the software's normal behaviour” (https://help.launchpad.net/BugStatuses).

Changed in coreutils:
status: New → Invalid
Changed in coreutils:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.