bug-sed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#34367: GNU sed v. 4.5 – Are printed the very rows aimed not to be pr


From: Assaf Gordon
Subject: 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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]