Re: passing a string with quotes as parameter



On Thu, 20 Oct 2005 09:23:50 +0200, Michael Moser wrote:

> No secret: it's SED (the stream editor - part of the cygwin utils
> (http://www.cygwin.com). I am trying to add a argument to an element in
> an XML file:

Under GnuSED you specify an embedded double quote as \x22
(using its ascii HEX value ).


> I.e. I want to change a an element <toc> to <toc href="some_url_here">
> so I was trying to specify:
> sed "s/<toc>/<toc href="some_url_here">/"
>
> It's the quotes that need to surround the URL that cause the trouble.
> And since there is a space after "toc" in the second string this needs
> to be quoted (otherwise I would only need to escape the redirection
> symbols "<" and ">").
>
> Michael
>
>
> "foxidrive" <woohoo@xxxxxxxxxxxxxx> wrote in message
> news:1ta8ryl876xv0$.132e1uik48fxf.dlg@xxxxxxxxxxxxx
>> On Wed, 19 Oct 2005 18:46:30 +0200, Michael Moser wrote:
>>
>> Tell us more about this program.
>>
>>> Ah - and I forgot: it also contains blanks, which why I have to quote
>>> it
>>> in the first place, i.e. I need something like:
>>>
>>> prgmname 'argument with "quotes" and blanks'
>>>
>>> But - alas - using ' or ` as quotes does not work. I faintly
>>> remember,
>>> that one could escape a " within a quoted string using "" or ^" , but
>>> none of these appear to work, either...
>>>
>>> Michael
>>>
>>>
>>> "Michael Moser" <michael-nospam.moser@xxxxxxxxxxxxxxxxxx> wrote in
>>> message news:OM8RNuM1FHA.2924@xxxxxxxxxxxxxxxxxxxxxxx
>>>> Is there REALLY, ABSOLUTELY NO WAY of passing a string that contains
>>>> double-quotes to a program?
>>>>
>>>> I am writing a batch-file and I need to call one program with a
>>>> parameter that contains a '"' (a douple quote). I am going circles
>>>> trying to persuade CMD.EXE to swallow this.
>>>>
>>>> Michael :-(
>>>>
>>>>
.



Relevant Pages

  • Re: Apple Lags Behind On DVD-R/RWs?
    ... If you had bothered to quote more than one you would ... refer to myself that way mr michael pervert glasser? ... Disk was shattered into many pieces. ...
    (comp.sys.mac.advocacy)
  • Re: Gear rack sources for small quantities?
    ... I get a bit squirrelly when dealing with places that have no price ... information available until you specify everything and get a quote (how ... can I make cost dependent engineering choices to specify things without ...
    (rec.crafts.metalworking)
  • Re: why ?
    ... Michael A. Terrell wrote: ... I can picture you sitting in the back corner of a party doing nothing but badgering every one that's enjoying them self's. ... Btw, your name was never used in the message, and the quote I was ...
    (sci.electronics.design)
  • Re: Pythonic use of CSV module to skip headers?
    ... Michael> cumbersome idiom every single time. ... In my example I flubbed and failed to specify the delimiter to the ... You can create a subclass of DictReader that plucks the first line out as a ...
    (comp.lang.python)
  • Re: simple ALTER TABLE question
    ... and the NOT NULL constraint added at column creation time makes sure ... "Michael C" wrote in message ... Finally, you should specify ...
    (microsoft.public.sqlserver.programming)

Quantcast