tail does not work with '+' short option
Bug #241555 reported by
Paolo Melacarne
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]
Changed in coreutils: | |
status: | Unknown → New |
Changed in coreutils: | |
status: | New → Fix Released |
To post a comment you must log in.
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: www.gnu. org/software/ coreutils/ faq/#Old- tail-plus- N-syntax- now-fails
http://
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).