windows - calling batch file with semicolon in parameters from cygwin -


i need call batch file inside cygwin 1 of it's parameters path-like string containing semicolons. in windows command line 1 enclose parameter in quotes (which need trimmed later on). approach doesn't wok in cygwin

example batch (echoes first 3 parameters)

echo %1  echo %2 echo %3 

windows cmd call

file.bat "a;b"  c  

ouput

 "a;b"  c  empty 

cygwin call

 ./file.bat "a;b" c 

output

  b  c 

including space anywhere inside quotes ensure parameter semicolon or comma passed correctly. although have admit not understand behavior whatsoever, seems working flawlessly.

./file.bat "a;b " c 

output

"a;b" c 

as @jeb mentioned in comment, enclosing quotes can trimmed accessing parameter variable this

 %~1  

Comments