Bug 175907
| Summary: | "tail +10" no longer works | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | John Ellson <john.ellson> |
| Component: | coreutils | Assignee: | Tim Waugh <twaugh> |
| Status: | CLOSED NOTABUG | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | rawhide | CC: | davej |
| Target Milestone: | --- | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2007-02-06 09:45:21 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
John Ellson
2005-12-16 04:09:20 UTC
sort is similarly broken. Here is what the tail man page actually says:
-n, --lines=N
output the last N lines, instead of the last 10
[...]
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.
So for tail, use 'tail -n +10'. If you really must use the old 'tail +10'
syntax (which is no longer described in the man page), set
_POSIX2_VERSION=199209 in the environment.
For more information, see:
info coreutils "Standards Conformance"
*** This bug has been marked as a duplicate of 174624 ***
Here is what the tail man page actually says:
-n, --lines=N
output the last N lines, instead of the last 10
...
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.
$ rpm -qf /usr/share/man/man1/tail.1.gz
coreutils-5.93-4.1
Not only that, but "tail --help" says the thing.
The problem came up because Sun's JAI installation script fails. Do you
really want to break hundreds of scripts by other vendors? Why?
Please make _POSIX2_VERSION=199209 the default.
OK, I get it, if you read the man page like a lawyer, and without previous knowledge, it doesn't actually say tail with an unadorned +N is permitted. Given the previous 30year usage of tail I think it might be a little clearer about the change. It should also properly document the environment variable setting for bringing the previous behavior back. The man page also doesn't describe -N, but "tail -30" works. REOPENED status has been deprecated. ASSIGNED with keyword of Reopened is preferred. The man page deliberately omits the description of this non-POSIX option form. |