On Thu, May 5, 2016 at 11:24 AM, David Allsopp wrote: > > I am trying to work out the precise details for character escaping when > starting a Cygwin process from a native (i.e. non-Cygwin) Windows process. <snip> > For example: > > argv[0] = "foo" > argv[1] = "bar baz" > > then the resulting command line string should be: > > lpCommandLine = "foo bar\" \"baz"
If I recall correctly, Windows cmd.exe uses the carrot (^) as the general escape from shell character, so C:\cygwin64\bin>.\echo.exe -e ^"hello\nworld^" hello world works. However, I've found Windows's interpretation to be inconsistent, so often have to play with it to find what the "right combination" is for a particular instance. I find echoing the parameters to a temporary text file and then using the file as input to be more reliable and easier to troubleshoot, and it breaks apart whether it is Windows cli inconsistencies or receiving program issues very nicely with the text file content as an intermediary -- Erik -- 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