From: Nicolas Bercher <nbercher@yahoo.fr>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] How to do this with [acme | sam | sed ] ?
Date: Fri, 11 Jan 2013 14:24:12 +0100 [thread overview]
Message-ID: <50F0127C.1010204@yahoo.fr> (raw)
In-Reply-To: <CAM6ozu5utQU7YJC7hcJGUR54bTL41U4DTi21FTd7Wat=BsvH2g@mail.gmail.com>
On 11/01/2013 14:10, Peter A. Cejchan wrote:
>> echo 'abcd(x+(y-z))efgh' | sed 's;\(;;' | sed 's;(.*)\);\1;'
>
> Thanks, this is fine for my purpose (porting from C to Go), thanks!
> Just removing parens around for and if statements on a single line.
>
> | 9 sed 's/\(//; s/(.*)\)/\1/'
> (linux's sed does not work with it)
Under Linux, you have to switch the syntax between escaped and literal
parenthesis, this works fine:
| 9 sed 's/(//; s/\(.*\))/\1/'
Nicolas
prev parent reply other threads:[~2013-01-11 13:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-11 11:19 Peter A. Cejchan
2013-01-11 11:44 ` Rudolf Sykora
2013-01-11 12:24 ` Peter A. Cejchan
2013-01-11 12:27 ` dexen deVries
2013-01-11 12:38 ` Bence Fábián
2013-01-11 14:24 ` erik quanstrom
2013-01-11 15:16 ` Rudolf Sykora
2013-01-11 11:46 ` Bence Fábián
2013-01-11 12:07 ` Peter A. Cejchan
2013-01-11 12:09 ` Nicolas Bercher
2013-01-11 13:10 ` Peter A. Cejchan
2013-01-11 13:24 ` Nicolas Bercher [this message]
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=50F0127C.1010204@yahoo.fr \
--to=nbercher@yahoo.fr \
--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).