Re: passing a string with quotes as parameter
- From: foxidrive <woohoo@xxxxxxxxxxxxxx>
- Date: Thu, 20 Oct 2005 19:03:51 +1000
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 :-(
>>>>
>>>>
.
- References:
- passing a string with quotes as parameter
- From: Michael Moser
- Re: passing a string with quotes as parameter
- From: Michael Moser
- Re: passing a string with quotes as parameter
- From: foxidrive
- Re: passing a string with quotes as parameter
- From: Michael Moser
- passing a string with quotes as parameter
- Prev by Date: Re: passing a string with quotes as parameter
- Next by Date: Re: passing a string with quotes as parameter
- Previous by thread: Re: passing a string with quotes as parameter
- Next by thread: Re: passing a string with quotes as parameter
- Index(es):
Relevant Pages
|