X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <533517069.6831891248978979849.JavaMail.root@sz0059a.emeryville.ca.mail.comcast.net> References: <20090728091647 DOT GK18621 AT calimero DOT vinschen DOT de> <533517069 DOT 6831891248978979849 DOT JavaMail DOT root AT sz0059a DOT emeryville DOT ca DOT mail DOT comcast DOT net> Date: Thu, 30 Jul 2009 14:50:10 -0400 Message-ID: Subject: Re: [1.7] bash UNC path bug? From: "Mark J. Reed" To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Thu, Jul 30, 2009 at 2:36 PM, Eric Blake wrote: >> > bash... maybe cygpath, seems to be doing something weird: > Weird - yes. But buggy - no. Backtick-quoting rules are strange. For instance, single quotes within backticks still prevent variable expansion: $ x=1 $ echo `echo '$x'` $x # not "1" So it's not as simple as backticks working like double quotes (within which single quotes have no effect whatsoever): $ echo " '$x' " '1' What's going on is that there's a rule that allows nesting backticks by using successively increasing numbers of backslashes in front of them: `outer \`inner \\\`innermost\\\` inner\` outer` and because of this, backticks essentially add yet another layer of backslash parsing and removal to the mix. This is the biggest reason to prefer new-style $(...) command substitution to backticks. None of this is Cygwin-specific, we just deal with literal backslashes more in Cygwinland thanks to DOS-style file paths. -- 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