Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 51444 - latest coreutils breaks obsolete usage of tail
Summary: latest coreutils breaks obsolete usage of tail
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-18 19:18 UTC by James Pattinson
Modified: 2004-05-18 19:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Pattinson 2004-05-18 19:18:20 UTC
Updated to coreutils-5.20 today as in the latest portage tree. Since then some of my scripts from a 3rd party app are failing. I tracked this down to tail:

greebo src # cat tail.c | tail +2
tail: cannot open `+2' for reading: No such file or directory

I think tail should print a warning out to STDERR like head does, instead of failing completely, e.g:

greebo src # cat head.c | head -2
head: `-2' option is obsolete; use `-n 2' since this will be removed in the future
/* head -- output first part of file(s)
   Copyright (C) 89, 90, 91, 1995-2004 Free Software Foundation, Inc.

Reproducible: Always
Steps to Reproduce:
cat <file> | tail +2
Actual Results:  
tail: cannot open `+2' for reading: No such file or directory


Expected Results:  
(to stderr)
tail: `+2' option is obsolete; use `-n 2' since this will be removed in the future


I know, I know, the scripts I'm using are broken... but would be nice if they
continued to work still. If you are interested, the 3rd party product in
question is Veritas NetBackup which generally works fine on Gentoo.
Comment 1 Travis Tilley (RETIRED) gentoo-dev 2004-05-18 19:34:50 UTC
export _POSIX2_VERSION="199209"

that should fix your problem. straight from the info page:

"The GNU utilities normally conform to the version of POSIX that is
 standard for your system.  To cause them to conform to a different
 version of POSIX, define the `_POSIX2_VERSION' environment variable to
 a value of the form YYYYMM specifying the year and month the standard
 was adopted.  Two values are currently supported for `_POSIX2_VERSION':
 `199209' stands for POSIX 1003.2-1992, and `200112' stands for POSIX
 1003.1-2001.  For example, if you are running older software that
 assumes an older version of POSIX and uses `sort +1', you can work
 around the compatibility problems by setting `_POSIX2_VERSION=199209'
 in your environment."