Hello. ==Preamble== Some time ago I noticed that cygwin executables (e.g. bash, tar, echo & so on) handle specially *, {} and some other symbols in command-line, even when being invoked not from shell (e.g. programmatic invocation or cmd.exe). After some googling, I found CYGWIN=noglob setting, which fixed the issue. After enabling it I hoped that cygwin executables will start parsing command-line in a standard for Windows executables way (I am not talking about path translation, only about handling special characters and splitting command string into argv array).
==Main== It revealed that even with CYGWIN=noglob, cygwin executables parse command line differently from other windows executables. (Again, I underline: I'm talking about invocation from cmd.exe or programmatic invocation, not invocation from bash.) Concretely, the 3rd and 4th test-cases from here fail: https://msdn.microsoft.com/en-us/library/windows/desktop/17w5ykft(v=vs.85).aspx. (BTW, ironically, with CYGWIN=glob only 3rd test-case fails.) ==Questions== So, questions are: 1. Is this behavior intentional, or is it bug? 1a. If intentional: Maybe there is a way to force cygwin executables to perform command-line parsing in windows-canonical way (i.e. CommandLineToArgv-like)? (I am talking about splitting command string into argv array, not about path translation.) 2. In any case, could you point me to part of cygwin sources which is responsible for this? (In case of intentionality -- to understand what behavior I'm now forced to adopt to, in case of bug -- to possibly aid fixing.) ==Test cases== 1. I compiled code from the link above with g++. 2. And written simple simple script in bash: > #!/bin/bash > for a in "$@"; do echo "$((++i)): $a"; done Both have same behavior, which differs from canonical windows parsing. ==Additional== What I'm trying to do? I am trying to find proper way of passing parameters to cygwin executables from non-cygwin application (which doesn't even know that it's dealing with cywgin). I suppose that if one wants *nix-typical parsing, he will use some shell (e.g. bash), or at least CYGWIN=glob. BTW, in CYGWIN=glob mode, curly braces are handled wrongly (c:\cygwin\echo.exe {aa} should return {aa}, not aa; because no , or .. inside {}). -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple