From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16802 invoked by alias); 9 Sep 2009 16:10:52 -0000 Received: (qmail 16698 invoked by uid 22791); 9 Sep 2009 16:10:50 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-px0-f204.google.com (HELO mail-px0-f204.google.com) (209.85.216.204) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Sep 2009 16:10:45 +0000 Received: by pxi42 with SMTP id 42so3968099pxi.20 for ; Wed, 09 Sep 2009 09:10:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.115.45.5 with SMTP id x5mr552879waj.182.1252512644135; Wed, 09 Sep 2009 09:10:44 -0700 (PDT) In-Reply-To: <20090909160513.GB29151@ednor.casa.cgf.cx> References: <796377.93249.qm@web30205.mail.mud.yahoo.com> <20090909160513.GB29151@ednor.casa.cgf.cx> Date: Wed, 09 Sep 2009 16:10:00 -0000 Message-ID: Subject: Re: syntax for Cygwin bash invoking Win apps From: "Mark J. Reed" To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2009-09/txt/msg00206.txt.bz2 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 tr= ied >>>>> this with other Windows apps too, and the same weirdness seems to occ= ur. >> >>Larry Hall: >>>>All of the above is consistent with bash shell quoting. >> >>No, it's really not. =C2=A0Those backslashes should be long gone by the >>time cmd.exe gets its arguments, yet it echoes them. =C2=A0It 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. =C2=A0It'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\\\""]. --=20 Mark J. Reed -- 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