The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.tcl
From: Alexandre Ferrieux <alexandre.ferri...@gmail.com>
Date: Mon, 22 Sep 2008 09:06:17 -0700 (PDT)
Local: Mon, Sep 22 2008 12:06 pm
Subject: Re: exec sed with special arguments
On Sep 22, 5:25 pm, trighole <fabrice.bernardgran...@gmail.com> wrote:
> Hello, Beware single quote is not a metacharacter in Tcl. You want: > I try to use sed command with special arguments and it fails. exec sed -e "/\{/aTITI" -e "/\{/iTOTO" > To solve it I use \ to 'protect' the curly brace First I think the first expression started with '/\{' and not '\/ > exec sed -e '\/{/aTITI' -e '/\{/iTOTO' inFile > outFile > and TCL error is sed: -e expression #1, char 1: Unknown command: `'' {' (otherwise you'd have received the same punition as before). Second, this shows you that the single quotes are passed to the underlying program (sed) as normal characters, as explained above. Of course usually you type all this in one of the sh or csh families, where single quotes play a different role ;-) > 2- I also want to replace After visiting sh's and (a bit of) Tcl's Quoting Hells, welcome to > //BLABLA by //BLOBLO > exec sed -e "s//BLABLA///BLOBLO" inFile > outFile > TCL error: sed: -e expression #1, char 0: No previous regular > expression sed's :-) Though you can escape slashes this way: exec sed -e "s/\\/\\/BLABLA/\\/\\/BLOBLO/" or (only Tcl-quoting differs): exec sed -e {s/\/\/BLABLA/\/\/BLOBLO/} sed has a much nicer tool: you can use any character instead of "/" as exec sed -e s@//BLABLA@//BLOBLO@ -Alex > To solve it I use \ to 'protect' /
> I still got the same error. > Can U help me > thanks > fab You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||