From: Eckard Brauer <eckard.brauer@gmx.de>
To: 9front@9front.org
Subject: Re: [9front] sed bug?
Date: Tue, 13 Nov 2018 21:28:06 +0100 [thread overview]
Message-ID: <20181113212806.523d19f7@gmx.de> (raw)
In-Reply-To: <20181113200401.GA18169@master>
[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]
At least it look inconsistent:
% {echo test; echo test1; echo test2;echo test3} | sed '1,/^test$/d'
% {echo test; echo test1; echo test2;echo test3} | sed '1,/^test1$/d'
test2
test3
% {echo test; echo test1; echo test2;echo test3} | sed '1,/^test2$/d'
test3
seems search starts just after addressed line (1 in this case): in fist
case nothing is found, so search goes until end, then mothing remains
for output.
as the man page states:
[address [, address] ] function [argument ...]
as valid, "1/test$/d' should work, but it seems not to be the case:
% {echo test; echo test1; echo test2;echo test3} | sed '1/^test$/d'
sed: Unrecognized command: 1/^test$/d
BTW, GNU sed (Linux) seems to behave similar.
Am Tue, 13 Nov 2018 13:04:01 -0700
schrieb Joe M <joe9mail@gmail.com>:
> Hello,
>
> umbraticus@prosimetrum.com wrote:
> [...]
> [...]
>
> yes, my bad. I pasted the wrong command. It should be a 1 instead of
> 0.
>
> [...]
> [...]
> [...]
>
> I stumbled upon the same workaround too. On a similar note, this
> command works fine also:
>
> {echo test; echo test1; echo test2} | sed '1,1d'
>
> Thanks again
--
:)
[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2018-11-13 20:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-13 19:32 umbraticus
2018-11-13 20:04 ` Joe M
2018-11-13 20:28 ` Eckard Brauer [this message]
2018-11-13 20:32 ` Dave MacFarlane
2018-11-13 20:55 ` Eckard Brauer
2018-11-13 20:43 ` Antons Suspans
2018-11-13 21:07 ` Eckard Brauer
2018-11-13 21:09 ` Eckard Brauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181113212806.523d19f7@gmx.de \
--to=eckard.brauer@gmx.de \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).