This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: syntax for Cygwin bash invoking Win apps


On Wed, Sep 9, 2009 at 12:05 PM, Christopher Faylor wrote:
>>>>> $ cmd /c echo "\"abc\""
>>>>> "\"abc\""
>>>>>
>>>>> # Wahhh?!
>>>>>
>>>>> Anyone who knows the explanation would make me very grateful. I've tried
>>>>> this with other Windows apps too, and the same weirdness seems to occur.
>>
>>Larry Hall:
>>>>All of the above is consistent with bash shell quoting.
>>
>>No, it's really not. ÂThose backslashes should be long gone by the
>>time cmd.exe gets its arguments, yet it echoes them. ÂIt seems that
>>the Cygwin version of bash stops short before doing some of the work
>>it normally does itself on other systems, assuming the executed
>>command will have its command line run through the preprocessor in the
>>Cygwin DLL.
>
> Actually, I'd say that was cmd doing something funky. ÂIt's hard to believe
> that bash was actually special-casing cmd.exe.

I don't think it's special-casing cmd.exe.  I think some of the
command line processing that is done by bash on Linux has been moved
out of bash and into the DLL command line preprocessor on Cygwin.

But even if I'm wrong about the details, bash has to be doing
something different here.  On any other UNIX system, the "cmd" command
would get an argv of ["cmd", "/c", "echo", "\"abc\""], but here it
seems to be getting ["cmd", "/c", "echo", "\\\"abc\\\""].

-- 
Mark J. Reed <markjreed@gmail.com>

--
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]