# Using backticks with xml

**URL:** <https://www.ruby-forum.com/t/using-backticks-with-xml/131901>\
**Category:** Ruby\
**Created:** [March 14, 2008, 7:45am UTC](https://www.ruby-forum.com/t/using-backticks-with-xml/131901 "2008-03-14T07:45:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Corbin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58f4c7/32.png) [@Corbin](https://www.ruby-forum.com/u/Corbin)\
**Post date:** [March 14, 2008, 7:45am UTC](https://www.ruby-forum.com/t/using-backticks-with-xml/131901/1 "2008-03-14T07:45:58Z")

</div>

I don’t know why I can’t do this but I’d like to use backticks in ruby  
to import some xml into a program on the command line.

e.g.

`java -cp myjar.jar Importer %Q{@xml}`

the problem is that the @xml needs to be escaped so that the double  
quotes can be placed inside double quotes so that it can be read in  
correctly… can this be done?

---

<div class="post-metadata">

**Author:** ![Corbin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58f4c7/32.png) [@Corbin](https://www.ruby-forum.com/u/Corbin)\
**Post date:** [March 14, 2008, 4:25pm UTC](https://www.ruby-forum.com/t/using-backticks-with-xml/131901/2 "2008-03-14T16:25:13Z")

</div>

Corbin wrote:

> I don’t know why I can’t do this but I’d like to use backticks in ruby  
> to import some xml into a program on the command line.
> 
> e.g.
> 
> `java -cp myjar.jar Importer %Q{@xml}`
> 
> the problem is that the @xml needs to be escaped so that the double  
> quotes can be placed inside double quotes so that it can be read in  
> correctly… can this be done?

`java -cp myjar.jar Importer \"#{@xml}\"`

-r.
