Bug 174785 - Tail does not understand "+2" as an option
Summary: Tail does not understand "+2" as an option
Keywords:
Status: CLOSED DUPLICATE of bug 174624
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 5
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-12-02 04:36 UTC by Anthony Thyssen
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2005-12-02 09:26:04 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Anthony Thyssen 2005-12-02 04:36:47 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051118 Fedora/1.5-0.5.0.rc3 Firefox/1.5

Description of problem:
The use of a command such as
    tail +2  file
has been a standard part of UNIX from before I graduated (1988!)
This is the first time I have ever see the above option report...
    tail: cannot open `+2' for reading: No such file or directory

This is not good, I know of hundreds, if not thousands of UNXI shells scripts that rely on tail +2 printing a file from the second line onward.

EG: from the FC5 manual...
   If the first character of N (the number of bytes or lines)  is  a  â+â,
       print  beginning  with the Nth item from the start of each file

This includes the use  of just + instead of -+2  which also failes to work!


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

How reproducible:
Always

Steps to Reproduce:
1.  tail +2 .xsession-errors
2.
3.
  

Actual Results:      tail: cannot open `+2' for reading: No such file or directory
followed by a filename header, and the last ten lines of the file!

Expected Results:  no header (only one filename given.
all the lines of the file except the first (eg line N onward)


Additional info:

The use of +N as a option for tail has been present since the 1970's!
It must be provided for compatability.

This could cause sever problems as it impairs the working of existing shell scripts.

Comment 1 Tim Waugh 2005-12-02 09:26:04 UTC
Use 'tail -n +2'.

*** This bug has been marked as a duplicate of 174624 ***


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