GNU bug report logs - #34367
GNU sed v. 4.5 – Are printed the very rows aimed not to be printed.

Previous Next

Package: sed;

Reported by: Ricky Tigg <ricky.tigg <at> gmail.com>

Date: Thu, 7 Feb 2019 11:08:02 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.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 34367 in the body.
You can then email your comments to 34367 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-sed <at> gnu.org:
bug#34367; Package sed. (Thu, 07 Feb 2019 11:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ricky Tigg <ricky.tigg <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-sed <at> gnu.org. (Thu, 07 Feb 2019 11:08:02 GMT) Full text and rfc822 format available.

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

From: Ricky Tigg <ricky.tigg <at> gmail.com>
To: bug-sed <at> gnu.org
Subject: GNU sed v. 4.5 – Are printed the very rows aimed not to be printed.
Date: Thu, 7 Feb 2019 12:06:22 +0100
[Message part 1 (text/plain, inline)]
Hi. Command executed focusing on an USB device's whole block:

# fsck /dev/sdc | sed '1,2d'
e2fsck 1.44.3 (10-July-2018)
e2fsck: need terminal for interactive repairs:

Are printed the very rows aimed not to be printed; then *Sed* behaved
according to command sed '1,2!d'.

For comparison (*whole* output is here mentioned) :

# fsck /dev/sdc
fsck from util-linux 2.32.1
e2fsck 1.44.3 (10-July-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdc

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Unexpectedly there is no mention of the output resulting from the first
command. Regards.
[Message part 2 (text/html, inline)]

Information forwarded to bug-sed <at> gnu.org:
bug#34367; Package sed. (Thu, 07 Feb 2019 22:29:02 GMT) Full text and rfc822 format available.

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

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Ricky Tigg <ricky.tigg <at> gmail.com>, 34367 <at> debbugs.gnu.org
Subject: Re: bug#34367: GNU sed v. 4.5 – Are printed the very rows aimed not to be printed.
Date: Thu, 7 Feb 2019 15:27:57 -0700
tags 34367 notabug
close 34367
stop

Hello,

On 2019-02-07 4:06 a.m., Ricky Tigg wrote:
> # fsck /dev/sdc | sed '1,2d'
> e2fsck 1.44.3 (10-July-2018)
> e2fsck: need terminal for interactive repairs:
> 
> Are printed the very rows aimed not to be printed; then *Sed* behaved
> according to command sed '1,2!d'.
> 

"fsck" prints these lines to STDERR, which is not piped to sed,
hence they are printed.

Observe:

  $ /sbin/fsck.ext3 foo > /dev/null
  e2fsck 1.43.4 (31-Jan-2017)
  e2fsck: need terminal for interactive repairs

versus:

  $ /sbin/fsck.ext3 foo 2> /dev/null
  foo: clean, 11/128 files, 38/1024 blocks


Also,
Notice "fsck" warns you that STDOUT is not a terminal
(because of piping to sed), and that would lead to
weird/unexpected output in interactive mode.

regards,
 - assaf






Added tag(s) notabug. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 07 Feb 2019 22:29:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 34367 <at> debbugs.gnu.org and Ricky Tigg <ricky.tigg <at> gmail.com> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 07 Feb 2019 22:29: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. (Fri, 08 Mar 2019 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 48 days ago.

Previous Next


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