From: Rudolf Sykora <rudolf.sykora@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] awk help; not plan9 matter
Date: Thu, 17 Sep 2009 23:09:50 +0200 [thread overview]
Message-ID: <a560a5d00909171409g6425c9feu239ac381b1e813a3@mail.gmail.com> (raw)
In-Reply-To: <4f538c0e46da2504838ea771312e7c74@quanstro.net>
2009/9/17 erik quanstrom <quanstro@quanstro.net>:
> i don't think you need an extra () for the leading
> white space. just tack it on in with the leading expression.
see below
> the hoc is unnecessary. just start with 2.
true :)
> fn buildre {
> re = 's:^([ ]*'
> for(i in `{seq 2 $1})
> re = $re ^ '[^ ]+[ ]+'
> re = $re ^ ')([^ ]+):\1' ^ $2:
> }
>
> ; buildre 1 hell
> ; whatis re
> re='s:^([ ]*)([^ ]+):\1hell:'
already here is a problem:
1) I am to save the leading space --- so it shouldn't be an argument to s.
2) only the 2nd () --- the word with no spaces in itself --- is to be changed
... since the spaces are to be preserved, none of them should be an
argument to the s command, I think. That's why it was treated
seperately by me.
Anyway, what do you think about that problem with the empty group? Why
linux is ok with it while plan 9 is not? Is there any reason? Is that
a bug in plan9 sed?
Thanks
Ruda
> ; buildre 2 hell
> ; whatis re
> re='s:^([ ]*[^ ]+[ ]+)([^ ]+):\1hell:'
>
> - erik
>
>
next prev parent reply other threads:[~2009-09-17 21:09 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-17 8:23 Rudolf Sykora
2009-09-17 8:37 ` matt
2009-09-17 8:52 ` Rudolf Sykora
2009-09-17 9:04 ` matt
2009-09-17 9:12 ` Rudolf Sykora
2009-09-17 10:42 ` Rudolf Sykora
2009-09-17 12:35 ` yy
2009-09-17 12:55 ` Rudolf Sykora
2009-09-17 15:51 ` Lyndon Nerenberg - VE6BBM/VE7TFX
2009-09-17 16:02 ` erik quanstrom
2009-09-17 16:20 ` roger peppe
2009-09-17 16:55 ` Rudolf Sykora
2009-09-17 17:04 ` erik quanstrom
2009-09-17 17:10 ` erik quanstrom
2009-09-17 17:19 ` Rudolf Sykora
2009-09-17 17:34 ` roger peppe
2009-09-17 20:33 ` Rudolf Sykora
2009-09-17 20:46 ` erik quanstrom
2009-09-17 21:09 ` Rudolf Sykora [this message]
2009-09-17 21:22 ` Rudolf Sykora
2009-09-17 21:24 ` erik quanstrom
2009-09-17 14:16 ` Noah Evans
2009-09-17 14:45 ` roger peppe
2009-09-17 17:03 ` Rudolf Sykora
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=a560a5d00909171409g6425c9feu239ac381b1e813a3@mail.gmail.com \
--to=rudolf.sykora@gmail.com \
--cc=9fans@9fans.net \
/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).