timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-4639] improve help tip: some special characters are removed in windows batch commands #236

Open timja opened 14 years ago

timja commented 14 years ago

I have this command in "Execute windows batch commands" section. Look at the
string GFv3%20Trunk. When executed the %2 is removed and string becomes like
GFv30Trunk. I tried to escape the character using "\" and enclosing the entire
string in double quotes, but it does't work.

wget -nv
"http://gf-hudson.sfbay.sun.com/hudson/view/GFv3%20Trunk/job/gf-trunk-build-continuous/lastSuccessfulBuild/artifact/bundles/glassfish.zip"

wget -nv
http://gf-hudson.sfbay.sun.com/hudson/view/GFv30Trunk/job/gf-trunk-build-continuous/lastSuccessfulBuild/artifact/bundles/glassfish.zip


Originally reported by sankarpn, imported from: improve help tip: some special characters are removed in windows batch commands
  • status: Open
  • priority: Major
  • resolution: Unresolved
  • imported: 2022/01/10
timja commented 14 years ago

twpol:

That's probably normal Windows batch processing; %0, %1, though %9 are the script and its arguments. Since Hudson creates (at least in my testing) a temporary .bat file with the command in and runs that, these will be replaced by the Windows batch processor.

Try using ^ to escape the %.

timja commented 13 years ago

evernat:

twpol is right, that's normal Windows batch processing; %0, %1, though %9 are replaced by the script file name and its arguments.

But % (not ^) is needed to escape the %.

I think that it could be added in the help for the field of windows batch commands something like:

The character ^ can be used to escape the special characters <, >, |, &, or ^ ("^>" for example).
And the character % can be used to escape the % characters ("%%" for example).