X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <46F9AA3C.3227153@dessent.net> Date: Tue, 25 Sep 2007 17:39:24 -0700 From: Brian Dessent X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: cygpath -u doesn't seem to convert spaces properly References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com 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 Jerome Fong wrote: > $ cd $ttt > bash: cd: /cygdrive/c/Program: No such file or directory Yes, that's wrong. But more importantly, it's not wrong just in the POSIX/Win32 path sense, it's wrong in the sense that it can't cope with any argument that contains whitespace. Your script would also fail on a Linux system that for example had a directory like "~/some files" -- and in that case there is no 8.3 short filename hack to save you, so there is no avoiding the need for proper quoting. It's got nothing to do with cygpath and everything to do with proper portable scripting practice. > Is is possible to setup the variable to not require the double quotes? Only if you neglect to support filenames and paths with spaces in them. > Since my other method doesn't require the double quotes, it would > make the scripting much easier. I wouldn't need to keep track of which > variables I had to double quote. Easier perhaps but still broken. Brian -- 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/