Subject: Re: bug#60215: tail -c +XX on newer coreutils wants FILE

From: Pádraig Brady <[email-masked]>
Date: Tue, 20 Dec 2022 13:04:57 +0000

tag 60215 notabug
close 60215
stop

On 20/12/2022 09:30, Arkadiusz Miśkiewicz via GNU coreutils Bug Reports wrote:
> 
> # echo tessdfdsdsfdsfdsfdsfsdft | tail -c +13
> sfdsfdsfsdft
> # tail --version
> tail (GNU coreutils) 8.32
> Copyright (C) 2020 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <https://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> Written by Paul Rubin, David MacKenzie, Ian Lance Taylor,
> and Jim Meyering.
> 
> 
> while on newer version:
> 
> $ echo tessdfdsdsfdsfdsfdsfsdft | tail -c +13
> tail: cannot open '+13' for reading: No such file or directory
> $ tail --version
> tail (GNU coreutils) 9.1
> Copyright (C) 2022 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <https://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> Written by Paul Rubin, David MacKenzie, Ian Lance Taylor,
> and Jim Meyering.
> 
> 
> Looking at NEWS but don't see any behaviour change info, so I guess it's
> a bug.

I suspect you have _POSIX2_VERSION set somehow,
either in the environment or at build time.

The following should be instructive:

$ echo tessdfdsdsfdsfdsfdsfsdft | _POSIX2_VERSION=199209 tail -c +13
tail: cannot open '+13' for reading: No such file or directory

$ echo tessdfdsdsfdsfdsfdsfsdft | _POSIX2_VERSION=200112 tail -c +13
sfdsfdsfsdft

$ echo tessdfdsdsfdsfdsfdsfsdft | _POSIX2_VERSION=199209 tail -c+13
sfdsfdsfsdft

There are some details about this at:
https://www.gnu.org/software/coreutils/manual/html_node/Standards-conformance.html

thanks,
Pádraig