bug-sed
[Top][All Lists]
Advanced

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

bug#62144: Unexpected output


From: walonen
Subject: bug#62144: Unexpected output
Date: Sun, 12 Mar 2023 09:05:37 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

Hello,
I have found an unexpected behavior of sed. I would expect the same
output for the following commands:

sed '/root/!d' /etc/passwd
sed '/root/{ !d }' /etc/passwd

$ sed --version
sed (GNU sed) 4.7
Packaged by Debian
Copyright (C) 2018 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 Jay Fenlason, Tom Lord, Ken Pizzini,
Paolo Bonzini, Jim Meyering, and Assaf Gordon.
GNU sed home page: <https://www.gnu.org/software/sed/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
Fehlerberichte bitte per E-Mail (auf englisch) an: <bug-sed@gnu.org>.



Seen ouotput:

$ sed '/root/!d' /etc/passwd
root:x:0:0:root:/root:/bin/bash

$ sed '/root/{ !d }' /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
... the whole file

BR,
Stefan Scheruebl


reply via email to

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