[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 5.93 tail -N foo bar invalid option
From: |
Paul Eggert |
Subject: |
Re: 5.93 tail -N foo bar invalid option |
Date: |
Sun, 29 Jan 2006 21:37:04 -0800 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
address@hidden (Karl Berry) writes:
> In coreutils 5.93, with _POSIX2_VERSION=0 (and POSIXLY_CORRECT unset),
> touch foo bar
> tail -3 foo bar
> yields the error
> tail: invalid option -- 3
> Both `tail -3 foo' and `head -3 foo bar' are ok.
Well, that's a long story.
7th Edition Unix "tail -3 foo bar" ignores "bar", and Solaris 10
"/usr/bin/tail" follows in this ancient and bogus tradition. SUSv2
(1997) requires support for "tail -3 foo" and for "head -3 foo bar",
but it understandably does not require support for "tail -3 foo bar".
When I ran into this a while ago, I decided not to change GNU tail to
support 7th Edition Unix behavior, as that behavior is
counterintuitive and confusing and no standard requires it. I thought
it better to reject that usage entirely.
However, if some actual programs rely on the 7th Edition Unix
behavior, I suppose that would be an argument for changing coreutils
"tail" to behave compatibly.
The coreutils documentation says this:
For compatibility @command{tail} also supports an obsolete usage
@samp{tail address@hidden address@hidden, which is recognized
only if it does not conflict with the usage described
above.
This says "tail -3 foo bar" is not supported, but it does not say so
explicitly. Do you think an explicit statement would be helpful?