GNU bug report logs - #13300
tail - backwards compatibility (tail +$line $filename)

Previous Next

Package: coreutils;

Reported by: Martyn Hare <martynhare <at> lavabit.com>

Date: Fri, 28 Dec 2012 23:27:01 UTC

Severity: normal

Tags: notabug

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13300 in the body.
You can then email your comments to 13300 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#13300; Package coreutils. (Fri, 28 Dec 2012 23:27:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Martyn Hare <martynhare <at> lavabit.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 28 Dec 2012 23:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Martyn Hare <martynhare <at> lavabit.com>
To: "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: tail - backwards compatibility (tail +$line $filename)
Date: Fri, 28 Dec 2012 20:27:57 +0000
[Message part 1 (text/plain, inline)]
Dear Sir/Madam,

I think I've found a backwards-compatibility issue with tail.  I know that invoking tail without the -n argument when skipping lines (`tail +10 file.txt`) is bad syntax, but it needs to be supported for backwards-compatibility.  For example, the Unreal Tournament GOTY installer by Loki Games depends on this style of syntax - and modern GNU tail breaks the script.

I know that the GNU values software design quality deeply and in an ideal world, everyone would use `tail -n +10 file.txt` style of syntax, but some older script-driven installers don't do this, and this problem impacts less tech-savvy end-users (people who don't even know what tail is for!).

Any chance you could allow the older "bad" way to use the command?

Regards,

Martyn

P.S. Much love for all the hard work guys, I've not seen a single segfault in any release version of a GNU tool. Ever.
 		 	   		  
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#13300; Package coreutils. (Fri, 28 Dec 2012 23:47:02 GMT) Full text and rfc822 format available.

Message #8 received at 13300 <at> debbugs.gnu.org (full text, mbox):

From: Bob Proulx <bob <at> proulx.com>
To: Martyn Hare <martynhare <at> lavabit.com>
Cc: 13300 <at> debbugs.gnu.org
Subject: Re: bug#13300: tail - backwards compatibility (tail +$line $filename)
Date: Fri, 28 Dec 2012 16:45:56 -0700
tag -1 notabug
close -1
thanks

Martyn Hare wrote:
> I think I've found a backwards-compatibility issue with tail.  I
> know that invoking tail without the -n argument when skipping lines
> (`tail +10 file.txt`) is bad syntax, but it needs to be supported
> for backwards-compatibility.
>
> Any chance you could allow the older "bad" way to use the command?

Yes.  Set _POSIX2_VERSION=199209 to obtain the previous behavior.
  
> For example, the Unreal Tournament GOTY installer by Loki Games
> depends on this style of syntax - and modern GNU tail breaks the
> script.

It is probably best to set the variable just for the installer.

  $ env _POSIX2_VERSION=199209 ./ut-installer

This is one of those frequently asked questions which has an FAQ entry
that talks about it in some detail:

  http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Old-tail-plus-N-syntax-now-fails

Also the topic is documented in the manual.  The manual says this:

     For compatibility `tail' also supports an obsolete usage `tail
  -[COUNT][bcl][f] [FILE]', which is recognized only if it does not
  conflict with the usage described above.  This obsolete form uses
  exactly one option and at most one file.  In the option, COUNT is an
  optional decimal number optionally followed by a size letter (`b', `c',
  `l') to mean count by 512-byte blocks, bytes, or lines, optionally
  followed by `f' which has the same meaning as `-f'.

     On older systems, the leading `-' can be replaced by `+' in the
  obsolete option syntax with the same meaning as in counts, and obsolete
  usage overrides normal usage when the two conflict.  This obsolete
  behavior can be enabled or disabled with the `_POSIX2_VERSION'
  environment variable (*note Standards conformance::).
  ...
     Newer versions of POSIX are occasionally incompatible with older
  versions.  For example, older versions of POSIX required the command
  `sort +1' to sort based on the second and succeeding fields in each
  input line, but starting with POSIX 1003.1-2001 the same command is
  required to sort the file named `+1', and you must instead use the
  command `sort -k 2' to get the field-based sort.

     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 have a newer system but are running
  software that assumes an older version of POSIX and uses `sort +1' or
  `tail +10', you can work around any compatibility problems by setting
  `_POSIX2_VERSION=199209' in your environment.

> P.S. Much love for all the hard work guys, I've not seen a single
> segfault in any release version of a GNU tool. Ever.

Yay!  Thanks for the feedback.  :-)

Bob




Added tag(s) notabug. Request was from Bob Proulx <bob <at> proulx.com> to control <at> debbugs.gnu.org. (Fri, 28 Dec 2012 23:49:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 13300 <at> debbugs.gnu.org and Martyn Hare <martynhare <at> lavabit.com> Request was from Bob Proulx <bob <at> proulx.com> to control <at> debbugs.gnu.org. (Fri, 28 Dec 2012 23:49:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 26 Jan 2013 12:24:02 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 143 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.