• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Escaping & in command prompt

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
How to escape & in command prompt. The whole idea is to pass a URL as a command line argument. But that URL contains & symbols. So I am getting the following error.
"'pid' is not recognized as an internal or external command,
operable program or batch file."

See the below ant script
<target name="x" depends="y">
<java classname="${main-class}" fork="true" failonerror="yes">
<classpath>
<path refid="lib.classpath" />
<fileset dir="${z}" includes="**/*.jar" />
</classpath>
<arg value="${URL}" />
</java>
</target>

Thanks
Anish
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which operating system are you using? I'd suggest googling "escape characters on command line <insert you OS here>"
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unix uses the "&" character to put jobs into the background; I don't know if DOS uses it or not.
 
anish do
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using windows XP. I can pass the url in double quotes. Thanks for your help. If you know any other ways to resolve this issue please let me know

Thanks
Anish
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic