delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/05/03/16:05:32

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; q=dns; s=default; b=uy
tHMxS24twKewguJnDatd7s5TetdcPFgMztzEoRh9eOUqzF4Rn0f4h90hAhEcfTyz
f/hBZtBmm8SrDGzGNFnhxB8HoXGZqY14FU0RvAF8gh1Y1BsWhA4OVhJjuSZv86PT
c3ykVHJfOXbK1q7JJa5jE4VWUIpSj/SeziNwbefgY=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; s=default; bh=yFyevjuv
OExld1idt7U01FyhzW4=; b=nX/ThK8cggDTc3A6Z7Vc5QOP4nk+0HbQ/TAJeADz
OiqXqX4oh9WlHJNovZT1HjD3HjYVRZKoZXU8rsXGrQgYJ1YJZDcsBGXGW5BMBlcg
uNtV/gZwmG0ZvO+XqM/17F47i8piSmIr3Z6btulk7i8rIup+8/BiWq7/p13YKfzR
b90=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-qk0-f170.google.com
MIME-Version: 1.0
X-Received: by 10.140.201.4 with SMTP id w4mr24673592qha.11.1430683510938; Sun, 03 May 2015 13:05:10 -0700 (PDT)
In-Reply-To: <CA+Ni7jNBd0WZu37OMiPEyvxwkgvYnDfonKoLjpuvNrZ95A9Rbw@mail.gmail.com>
References: <CA+Ni7jNBd0WZu37OMiPEyvxwkgvYnDfonKoLjpuvNrZ95A9Rbw AT mail DOT gmail DOT com>
Date: Mon, 4 May 2015 00:05:10 +0400
Message-ID: <CA+Ni7jMAtGL=xV2GoM5CCo282OdU1aDed++1kGX_UrrT=FbzFA@mail.gmail.com>
Subject: Re: Passing double quotes to DOS
From: =?UTF-8?B?0J/RkdGC0YAg0JEu?= <satnatantas AT gmail DOT com>
To: cygwin <cygwin AT cygwin DOT com>

https://cygwin.com/ml/cygwin/2002-02/msg00336.html


There was a statement saying that cygwin does everything to preserve double
quotes.

It does not. I was recently doing some symbolic links with "cmd /c mklink
"path" "filename" " recently and it was fine until I had a file with
ampersand.

If I type
cmd /c mklink "path" "filename"

cmd.exe is called without doubleqoutes (I use ProcExp to see cmd line).

If I type same thing in "Run" dialog of TaskManager, doublequotes are
passed as intended.


If I type
cmd /c mklink \"path\" \"filename\"

reverse slash spills to cmd line.

If I type
cmd /c mklink "\"path\"" "\"filename\""

reverse slash and all doubleqoutes spill to cmd line.


I really do not get it. How do I pass doubleqoutes to CMD? Problem is
not related to mklink or any internals of CMD and even bash - Cygwin
does not pass doubleqoutes instead.

Example:
echo "\"bbb\""
cmd /c echo "\"bbb\""

There must be an error somewhere on the CYGWIN/Windows boundary.

Can I somehow whitelist "cmd.exe" so it does not get special treatment?

CYGWIN_NT-6.1 USER 1.7.33-2(0.280/5/3) 2014-11-13 15:47 x86_64 Cygwin

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019