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
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 8
Hardware: i386
OS: Linux
low
high
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
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:
Clone Of:
Environment:
Last Closed: 2008-04-03 18:18:04 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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

uname -a:
Linux dv2727ca 2.6.24.3-50.fc8 #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.