Bug 199741 - tail(1) fails to parse plus-sign argument, reports error
tail(1) fails to parse plus-sign argument, reports error
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-21 13:58 EDT by David Rabson
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-24 05:13:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description David Rabson 2006-07-21 13:58:19 EDT
Description of problem:

  tail(1) fails to parse plus-sign argument; reports error

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

  5.93

How reproducible:

  /bin/echo "bad\ngood" | tail +2


should yield "good," instead gives an error message about not finding
a file called "+2".



  
Actual results:
  tail: cannot open `+2' for reading: No such file or directory

  
Expected results:
  good


Additional info:

It's possible this originates in an argument-parsing library.

This is an urgent bug on submitter's system, since it breaks
hundreds of local shell scripts.
Comment 1 David Rabson 2006-07-21 14:03:26 EDT
Correction to procedure to reproduce bug:

/bin/echo -e "bad\ngood" | tail +2


--

Comment 2 Tim Waugh 2006-07-24 05:13:49 EDT
The correct syntax for this is "tail -n +2 f".  You can get the old syntax
(which does not conform to the current POSIX spec) back like this:

export _POSIX2_VERSION=199209

See the info page aobut this:

  info coreutils "Standards Conformance"

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