Bug 174785

Summary: Tail does not understand "+2" as an option
Product: [Fedora] Fedora Reporter: Anthony Thyssen <anthony>
Component: coreutilsAssignee: Tim Waugh <twaugh>
Severity: high Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-12-02 04:26:04 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Anthony Thyssen 2005-12-01 23:36:47 EST
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):

How reproducible:

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

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 04:26:04 EST
Use 'tail -n +2'.

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