On Mon, 2 Apr 2001, Padraig Brady wrote:
> Nope the ' ' quotes stop the shell interpreting them.
> The \'s are required by sed.
>> Padraig.
Just to elaborate - 'cause somebody might find it interesting, I did ;)
- this is all down to the different 'syntax bits' used by sed, awk,
grep etc.
I've tried looking for the manual with the good explanation on this
that I found a while back - but I can't find it.... :(
But, if you look at /usr/include/regex.h, you'll find RE_SYNTAX_SED
defined and if you trace this back and look at all the syntax bits
defined for this you'll see exactly what needs to be escaped and what
doesn't.
So for sed, you need to escape '{','(','}' and ')' to give them their
special meaning 'cause RE_NO_BK_PARENS and RE_NO_BK_BRACES are not a
part of the RE_SYNTAX_SED syntax.
Good Luck,
Mark
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!