Bug 440449 - tail does not work when using + sign instead of - for number of lines
Summary: tail does not work when using + sign instead of - for number of lines
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils   
(Show other bugs)
Version: 8
Hardware: i386 Linux
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2008-04-03 16:10 UTC by John F
Modified: 2008-04-03 18:18 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-04-03 18:18:04 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description John F 2008-04-03 16:10:45 UTC
tail (GNU coreutils) 6.9

uname -a:
Linux dv2727ca #1 SMP Thu Mar 20 14:47:10 EDT 2008 i686 i686
i386 GNU/Linux

How reproducible:

Steps to Reproduce:
1. Run "cat /etc/passwd | head -3 | tail +2"
   -tail: cannot open `+2' for reading: No such file or directory
2. Run "cat /etc/passwd | tail +3 | head -2"
   -tail: cannot open `+3' for reading: No such file or directory 
Actual results:
The error messages above

Expected results:
Tail to pass the last two lines of the first three in the first example, and
tail to pass the first three lines to head in the second example.

these commands work on all other systems i have tested it on.  None of them are
fedora systems.

Additional info:

It seems that tail doesn't like +2 on fedora but works on Ubuntu, SuSE and all
other linux systems i try it on.

Comment 1 Ondrej Vasik 2008-04-03 18:18:04 UTC
Thanks for report, but it's not a bug. 

If Ubuntu, SUSE and other linux systems works, it does mean that they have VERY
old coreutils package(behaviour changed in 2005) or they made fork from upstream
in this case. Both is bad idea, as the current way how Fedora coreutils handles
this command conforms to the latest POSIX and upstream.

There is easy workaround to make tail working with "obsolete syntax" ... Simply add
alias tail="_POSIX2_VERSION=199209 tail"
to .bashrc (or to other file at system level which accepts aliases). 

You could read more in https://bugzilla.redhat.com/show_bug.cgi?id=287751 RHEL-5
bugzilla about that issue. 

Closing NOTABUG.

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