GNU bug report logs - #60215
tail -c +XX on newer coreutils wants FILE

Previous Next

Package: coreutils;

Reported by: Arkadiusz Miśkiewicz <arekm <at> maven.pl>

Date: Tue, 20 Dec 2022 09:31:01 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.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 60215 in the body.
You can then email your comments to 60215 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#60215; Package coreutils. (Tue, 20 Dec 2022 09:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arkadiusz Miśkiewicz <arekm <at> maven.pl>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 20 Dec 2022 09:31:02 GMT) Full text and rfc822 format available.

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

From: Arkadiusz Miśkiewicz <arekm <at> maven.pl>
To: bug-coreutils <at> gnu.org
Subject: tail -c +XX on newer coreutils wants FILE
Date: Tue, 20 Dec 2022 10:30:15 +0100
# 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.

-- 
Arkadiusz Miśkiewicz, arekm / ( maven.pl | pld-linux.org )




Information forwarded to bug-coreutils <at> gnu.org:
bug#60215; Package coreutils. (Tue, 20 Dec 2022 12:08:02 GMT) Full text and rfc822 format available.

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

From: Chris Elvidge <celvidge001 <at> gmail.com>
To: Arkadiusz Miśkiewicz <arekm <at> maven.pl>,
 60215 <at> debbugs.gnu.org
Subject: Re: bug#60215: tail -c +XX on newer coreutils wants FILE
Date: Tue, 20 Dec 2022 12:07:10 +0000

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.
> 

Works OK here. -c [+]13 includes the trailing newline (see hexdump below)

$ bash --version
GNU bash, version 5.2.15(1)-release (x86_64-slackware-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://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.

$ 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.

[0] slack15-a!chris:(pts/1):Tue 20 Dec 2022 11:44 am GMT:/home/chris
$ echo tessdfdsdsfdsfdsfdsfsdft | tail -c +13
sfdsfdsfsdft

[0] slack15-a!chris:(pts/1):Tue 20 Dec 2022 11:45 am GMT:/home/chris
$ echo tessdfdsdsfdsfdsfdsfsdft | tail -c 13
sfdsfdsfsdft

[0] slack15-a!chris:(pts/1):Tue 20 Dec 2022 11:48 am GMT:/home/chris
$ tail -c +13 <<<'tessdfdsdsfdsfdsfdsfsdft'
sfdsfdsfsdft

[0] slack15-a!chris:(pts/1):Tue 20 Dec 2022 11:50 am GMT:/home/chris
$ tail -c13 <<<'tessdfdsdsfdsfdsfdsfsdft'
sfdsfdsfsdft

[0] slack15-a!chris:(pts/1):Tue 20 Dec 2022 11:55 am GMT:/home/chris
$ tail -c13 <<<'tessdfdsdsfdsfdsfdsfsdft' | hexdump -c
0000000   s   f   d   s   f   d   s   f   s   d   f   t  \n
000000d


-- 

Chris Elvidge






Information forwarded to bug-coreutils <at> gnu.org:
bug#60215; Package coreutils. (Tue, 20 Dec 2022 12:44:02 GMT) Full text and rfc822 format available.

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

From: Arkadiusz Miśkiewicz <arekm <at> maven.pl>
To: Chris Elvidge <celvidge001 <at> gmail.com>, 60215 <at> debbugs.gnu.org
Subject: Re: bug#60215: tail -c +XX on newer coreutils wants FILE
Date: Tue, 20 Dec 2022 13:42:52 +0100
On 20.12.2022 13:07, Chris Elvidge wrote:

> 
> Works OK here. -c [+]13 includes the trailing newline (see hexdump below)

Version here is built via ./configure DEFAULT_POSIX2_VERSION=199209 and 
that changes behaviour.

Dropping it makes things work as expected. Thanks.

-- 
Arkadiusz Miśkiewicz, arekm / ( maven.pl | pld-linux.org )





Information forwarded to bug-coreutils <at> gnu.org:
bug#60215; Package coreutils. (Tue, 20 Dec 2022 13:06:01 GMT) Full text and rfc822 format available.

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

From: Pádraig Brady <P <at> draigBrady.com>
To: Arkadiusz Miśkiewicz <arekm <at> maven.pl>,
 60215 <at> debbugs.gnu.org
Subject: Re: bug#60215: tail -c +XX on newer coreutils wants FILE
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




Added tag(s) notabug. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Tue, 20 Dec 2022 13:06:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 60215 <at> debbugs.gnu.org and Arkadiusz Miśkiewicz <arekm <at> maven.pl> Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Tue, 20 Dec 2022 13:06: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. (Wed, 18 Jan 2023 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 150 days ago.

Previous Next


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