Mailinglist Archive: opensuse (818 mails)

< Previous Next >
Re: [opensuse] Java script assistance (slightly OT)
  • From: Per Jessen <per@xxxxxxxxxxxx>
  • Date: Thu, 22 Sep 2011 09:30:36 +0200
  • Message-id: <j5eo6r$c4p$>
David Haller wrote:


On Tue, 20 Sep 2011, Per Jessen wrote:
David Haller wrote:
On Mon, 19 Sep 2011, Per Jessen wrote:
sed -e 's/{/\n{/g' -e s'/}/}\n/g' -e s'/;/;\n/g' <filename

(still not sure if you need to escape the curly brackets).

You don't, as sed uses basic regular expressions (see 'man 7
regex'), so you need to escape {} to get "special" behaviour (if

Okay, but I was more thinking of escaping for the shell - for
when you use () for grouping, they need to be escaped to work. Which
I think(!) is a shell issue, not sed ?

Inside '' you only need to escape ' itself, which doesn't work, as \
has no special meaning either inside of ''.
Workaround: 'foo'"'"'bar' or 'foo'\''bar'

Inside "" you have to IIRC escape !"()`` and $ (the ! only if you've
enabled history substitution (set -H).

With sed, I always need to escape +() inside '' to get them to work. Am
I doing something wrong?

Per Jessen, Zürich (13.9°C)

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups