GNU bug report logs - #9370
"tail -f -1" should work

Previous Next

Package: coreutils;

Reported by: Eli the Beareded <gnu-bugs <at> panix.com>

Date: Thu, 25 Aug 2011 06:22:01 UTC

Severity: wishlist

To reply to this bug, email your comments to 9370 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#9370; Package coreutils. (Thu, 25 Aug 2011 06:22:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eli the Beareded <gnu-bugs <at> panix.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 25 Aug 2011 06:22:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Eli the Beareded <gnu-bugs <at> panix.com>
To: bug-coreutils <at> gnu.org
Subject: "tail -f -1" should work
Date: Thu, 25 Aug 2011 02:15:39 -0400 (EDT)
$ tail --version
tail (GNU coreutils) 8.5
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, Ian Lance Taylor,
and Jim Meyering.
$
$ tail -f -1 some.log
tail: option used in invalid context -- 1
$

On any other system I have used the -NUM option can be used with
the -f option to specify how many lines of the file as-is to print
before starting to follow it for updates.

With this version of tail, it always prints ten lines and then
starts the follow.

Elijah




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#9370; Package coreutils. (Thu, 25 Aug 2011 14:24:02 GMT) Full text and rfc822 format available.

Message #8 received at 9370 <at> debbugs.gnu.org (full text, mbox):

From: "Voelker, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>
To: Eli the Beareded <gnu-bugs <at> panix.com>, "9370 <at> debbugs.gnu.org"
	<9370 <at> debbugs.gnu.org>
Subject: RE: bug#9370: "tail -f -1" should work
Date: Thu, 25 Aug 2011 16:21:03 +0200
Eli the Beareded wrote:
> $ tail -f -1 some.log
> tail: option used in invalid context -- 1
> $

I think you wanted this:
$ tail -f -n1 some.log

The syntax is explained quite nice in recent versions:

    -n, --lines=K            output the last K lines, instead of the last 10;
                             or use -n +K to output lines starting with the Kth
  ...
  If the first character of K (the number of bytes or lines) is a `+',
  print beginning with the Kth item from the start of each file, otherwise,
  print the last K items in the file.  K may have a multiplier suffix: ...

Have fun,
Berny





Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#9370; Package coreutils. (Thu, 25 Aug 2011 18:52:01 GMT) Full text and rfc822 format available.

Message #11 received at 9370 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli the Beareded <gnu-bugs <at> panix.com>
Cc: 9370 <at> debbugs.gnu.org
Subject: Re: bug#9370: "tail -f -1" should work
Date: Thu, 25 Aug 2011 11:48:45 -0700
On 08/24/11 23:15, Eli the Beareded wrote:
> On any other system I have used the -NUM option can be used with
> the -f option to specify how many lines of the file as-is to print
> before starting to follow it for updates.

The interaction between -NUM and other options is so complicated
and unportable (different editions of the POSIX standards
disagree!) that GNU 'tail' is fairly conservative about where it
allows -NUM.  It might be nice to add support for your particular usage,
if someone wants to write the code, but it'll require some care to make
sure it doesn't run afoul of existing usage or standard in some other way.

In the meantime I suggest using "tail -f -n NUM", as that's standard
and portable these days.




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#9370; Package coreutils. (Tue, 13 Sep 2011 12:23:02 GMT) Full text and rfc822 format available.

Message #14 received at 9370 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Eli the Beareded <gnu-bugs <at> panix.com>, 9370 <at> debbugs.gnu.org
Subject: Re: bug#9370: "tail -f -1" should work
Date: Tue, 13 Sep 2011 14:18:03 +0200
tags 9370 notabug wishlist
thanks

Paul Eggert wrote:
> On 08/24/11 23:15, Eli the Beareded wrote:
>> On any other system I have used the -NUM option can be used with
>> the -f option to specify how many lines of the file as-is to print
>> before starting to follow it for updates.
>
> The interaction between -NUM and other options is so complicated
> and unportable (different editions of the POSIX standards
> disagree!) that GNU 'tail' is fairly conservative about where it
> allows -NUM.  It might be nice to add support for your particular usage,
> if someone wants to write the code, but it'll require some care to make
> sure it doesn't run afoul of existing usage or standard in some other way.
>
> In the meantime I suggest using "tail -f -n NUM", as that's standard
> and portable these days.

I've marked this as a wishlist item.




Severity set to 'wishlist' from 'normal' Request was from Jim Meyering <jim <at> meyering.net> to control <at> debbugs.gnu.org. (Tue, 13 Sep 2011 13:38:01 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 279 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.