--- Begin Message ---
Subject: |
Bug in the linux command: tail |
Date: |
Fri, 11 Mar 2011 10:03:14 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; HP-UX ia64; en-US; rv:1.7.12) Gecko/20051024 |
Tail with a line count option with multiple files fails.
For example:
tail -3 foo.txt
f
d
s
works, but
tail -3 foo.txt csh.cshrc
tail: option used in invalid context -- 3
This works on HP-UX.
fails.
It fails on Ubuntu 10.04 and redhat linux (latest version).
Roger Clark
Denver, CO
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#8231: Bug in the linux command: tail |
Date: |
Tue, 13 Sep 2011 13:13:39 +0200 |
tags 8231 + notabug
thanks
Paul Eggert wrote:
> On 03/11/2011 03:14 PM, Alan Curry wrote:
>> tail -N of multiple files used to work with GNU tail, before someone
>> broke it
>
> I checked in that change, and it was to make "tail" compatible with
> both older BSD practice and with POSIX 1002.1-2001. Any
> further changes in this area should retain compatibility with older
> BSD and with POSIX. It's not as easy as it looks, I'm afraid.
>
> A simple workaround (much simpler than trying to modify "tail" :-)
> is to use "tail -n10 A B" instead of "tail -10 A B".
This issue was beaten to death about 6 months ago.
I conclude that there was no official "bug" (at least no contravention of
POSIX), and that no one is planning to change this aspect of tail's behavior.
So I've closed it.
--- End Message ---