Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Escaping & in command prompt

 
anish do
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which operating system are you using? I'd suggest googling "escape characters on command line <insert you OS here>"
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic