www.delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-Spam-Check-By: | sourceware.org |
To: | cygwin AT cygwin DOT com |
From: | Jerome Fong <jfong AT successmetricsinc DOT com> |
Subject: | Re: cygpath -u doesn't seem to convert spaces properly |
Date: | Wed, 26 Sep 2007 11:22:13 -0700 |
Lines: | 31 |
Message-ID: | <fde80l$v4k$1@sea.gmane.org> |
References: | <46F9AA3C DOT 3227153 AT dessent DOT net> <4C89134832705D4D85A6CD2EBF38AE0F0131EF8F AT PAUMAILU03 DOT ags DOT agere DOT com> |
Mime-Version: | 1.0 |
User-Agent: | Thunderbird 2.0.0.6 (Windows/20070728) |
In-Reply-To: | <4C89134832705D4D85A6CD2EBF38AE0F0131EF8F@PAUMAILU03.ags.agere.com> |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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 |
Thanks, Jerome Williams, Gerald S (Jerry) wrote: > Brian Dessent wrote: >>> $ cd $ttt >>> bash: cd: /cygdrive/c/Program: No such file or directory >> Yes, that's wrong. [...] It's got nothing to do with >> cygpath and everything to do with proper portable scripting practice. > > Quite true. When you're using bash or sh, you must *quote > your arguments* if they could possibly contain spaces or > other word separators. So learn to do it. Seriously, take > a few minutes and try it: > > $ mkdir "a b c" > $ ABC="a b c" > bash: cd: a: No such file or directory > $ cd "$ABC" > ... etc. > > If you don't want to have to quote variable expansions all > the time, use another shell. I know that zsh, at least, > doesn't require you to quote them. That being said, you > still should learn how to quote in a regular POSIX shell. > Portable shell scripts should really start with #!/bin/sh, > after all. > > -gsw > -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |