X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Blake Subject: Re: cd to the path including space. Date: Thu, 8 Jan 2009 21:57:48 +0000 (UTC) Lines: 38 Message-ID: References: <20090108184458 DOT GC3521 AT ednor DOT casa DOT cgf DOT cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Christopher Faylor cygwin.com> writes: > > On Thu, Jan 08, 2009 at 04:46:26PM +0000, Eric Blake wrote: > >> findtexmf psfonts_t1.map > > > >cd "$(cygpath -u "$(findtexmf psfonts_t1.map)")" > > cd "$(cygpath -u '$(findtexmf psfonts_t1.map)')" > > will probably work a little better. As Eric knows, you can't nest quotes > that way. Huh? My example works just fine; it's yours that is broken (since '' surpresses the innermost $() command substitution): $ echo "$(echo '$(echo 'a b')')" $(echo a b) By the way, $() is saner than `` when it comes to nesting and "" (as required by POSIX): $ echo "$(echo "$(echo 'a b')")" a b Here's the same thing in properly quoted ``, at least when using a POSIX- compliant shell (in general, "`""`" is non-portable, since other bourne shell implementations parse it differently than what POSIX requires): $ echo "`echo \"\`echo 'a b'\`\"`" a b (in examples like these, I like to use two spaces to guarantee that I've used enough quoting) -- Eric Blake -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/