bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tail +n does not work under Linux?


From: Christophe LYON
Subject: Re: tail +n does not work under Linux?
Date: Mon, 11 May 2009 11:26:21 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090302)

On 07.05.2009 19:49, Matthew Woehlke wrote:
Christophe LYON wrote:

I am using coreutils-7.2, and I have just reproduced the issue with 7.3, under Linux RHEL 3 and 4.

Also with Fedora 10's 6.12 package. The behavior change I think may have been in 6.0 (it is probably in the changelog).

I do remember that change, but I also thought that it had been reverted a few releases later.

-<number> seems to work presently, +<number> doesn't.


This seems inconsistent to me. Am I the only one? :-)

Curiously, it works OK under Solaris 8.
Are you talking about GNU coreutils here, or the Solaris tail? If the behavior is different for GNU coreutils, that is probably a bug.

Yes, GNU coreutils built under Solaris.

Hmm. That sounds suspiciously like a bug, then. I don't think the behavior should be different across platforms. (Time for one of the maintainers to chime in...)

Well, I have re-read and tried doc kindly carbon-copied by A.Szmidt, and it seems that under Solaris coreutils default to an older POSIX version than under Linux.

But I still don't know how to know that at runtime. For instance 'tail --version' does not mention anything about that. It's probably not the right place to report, but I think there should be a most obvious way for the end-user to realize this issue.

But 'man tail' says:
       -n, --lines=N
output the last N lines, instead of the last 10; or use +N to output lines starting with the Nth

does it mean that '-n' is mandatory before a number? I interpreted it as '-number'.

I read it as, yes, -n is still required (but agree it isn't as clear as it might be), especially given the blurb in the info doc. IOW I read '+N' as replacing 'N', not as replacing '-n N' or '--lines=N'.


My understanding of this man fragment is that:
'-n 3' is equivalent to '--lines=3', and one can replace '3' by '+3'.

But I still don't see where '-3' is documented?


As mentioned earlier, at release 6.0 (approx), using '-3' stopped working. I remember I read the coretuils standard conformance doc at that time to understand the issue, and started modifying my scripts to use '-n 3' instead. Any a few coreutils releases later, I noticed '-3' worked again, but I guess I never understood why. So, I still don't :-)


Christophe.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]