Passing double/single quote in Nant task
Tasks like
For example, you cann't do this:
<exec workingdir="c:workingdir\bin" basedir="c:\executableDir" program="sar.exe" commandline="/s:ContentDB.config /d:..\..\ContentDB.config /f:"my file contains space" /i" />
Have tried a few ways to escape the double quote, not very sucessful. Suddenly I find we can do this:
1) add a property at top for double/single quote
2) use it!
<property name="quote" value='"' />
...
<exec workingdir="c:workingdir\bin" basedir="c:\executableDir" program="sar.exe" commandline="/s:ContentDB.config /d:..\..\ContentDB.config /f:${quote}my file contains space${quote} /i" />
1 comment:
Surely it's not NAnt that's complaining here; it's the XML parser used by NAnt.
Couldn't the same thing be achieved with an XML entity?
<exec
workingdir="c:workingdir\bin"
basedir="c:\executableDir"
program="sar.exe"
commandline="/s:ContentDB.config /d:..\..\ContentDB.config /f:"my file contains space" /i"
/>
Post a Comment