Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 679831 - --lines does not work: tailf: invalid option
--lines does not work: tailf: invalid option
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: util-linux-ng (Show other bugs)
6.1
x86_64 Unspecified
low Severity low
: rc
: ---
Assigned To: Karel Zak
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-23 11:13 EST by Michal Nowak
Modified: 2013-03-07 21:11 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-12-06 12:10:42 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1691 normal SHIPPED_LIVE Low: util-linux-ng security, bug fix, and enhancement update 2011-12-05 20:02:36 EST

  None (edit)
Description Michal Nowak 2011-02-23 11:13:00 EST
Description of problem:

Per

TAILF(1)

-n, --lines=N, -N
              output the last N lines, instead of the last 10.

[newman@dhcp-25-28 tmp]$ echo -e "XXX\nZZZ\nDDD" > file 
[newman@dhcp-25-28 tmp]$ cat file 
XXX
ZZZ
DDD
[newman@dhcp-25-28 tmp]$ tailf --lines=1 file 
tailf: invalid option
[newman@dhcp-25-28 tmp]$ echo $?
1

But:

[newman@dhcp-25-28 tmp]$ tailf -n 1 file 
DDD
^C

Works fine. So either --lines should be removed from tailf(1) man page of the code fixed (sources mention `--lines` option).

Version-Release number of selected component (if applicable):

util-linux-ng-2.17.2-10.el6.x86_64

How reproducible:

always
Comment 2 Karel Zak 2011-02-23 11:27:22 EST
(In reply to comment #0) 
> -n, --lines=N, -N
>               output the last N lines, instead of the last 10.

The tailf(1) command supports --lines command line option, but without '=', for example:

   tailf --lines 1 file

It's bug in the man page. 

Ideal solution is to update the code and use the standard getopt() there.
Comment 4 Karel Zak 2011-03-18 04:45:12 EDT
The upstream commit dc181a2115e71ac9d8ff07375330c3652288f348 fixes this problem, unfortunately it's too invasive for RHEL. 

For RHEL will be better to fix the tailf(1) man page.
Comment 9 errata-xmlrpc 2011-12-06 12:10:42 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2011-1691.html

Note You need to log in before you can comment on or make changes to this bug.