delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/10/03/11:07:55

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Wed, 3 Oct 2001 11:08:23 -0400
From: Christopher Faylor <cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Cc: jjl AT pobox DOT com
Subject: Re: spaces in paths in bash, and the FAQ
Message-ID: <20011003110823.F28936@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com, jjl AT pobox DOT com
References: <Pine DOT SOL DOT 4 DOT 30 DOT 0110031148590 DOT 18850-100000 AT mimosa DOT csv DOT warwick DOT ac DOT uk>
Mime-Version: 1.0
In-Reply-To: <Pine.SOL.4.30.0110031148590.18850-100000@mimosa.csv.warwick.ac.uk>
User-Agent: Mutt/1.3.21i

On Wed, Oct 03, 2001 at 12:24:53PM +0100, John J. Lee wrote:
>
>The FAQ has this to say about spaces in paths:
>
>> Can I use paths/filenames containing spaces in them?
>[...]
>> In particular, bash interprets space as a word separator. You would have
>> to quote a filename containing spaces, or escape the space character.
>> For example:
>>
>>         bash-2.03$ cd '/cygdrive/c/Program Files'
>>
>> or
>>
>>         bash-2.03$ cd /cygdrive/c/Program\ Files
>
>which is what I'd expect from using linux.
>
>However,
>
>$ py='/d/Program Files/Python21/python.exe'
>$ echo $py
>/d/Program Files/Python21/python.exe
>$ $py
>bash: /d/Program: No such file or directory
>$ py='/d/Program\ Files/Python21/python.exe'
>$ echo $py
>/d/Program\ Files/Python21/python.exe
>$ $py
>bash: /d/Program\: No such file or directory
>
>but
>
>$ /d/Program\ Files/Python21/python.exe
>Python 2.1.1 (#20, Jul 20 2001, 01:19:29) [MSC 32 bit (Intel)] on win32
>Type "copyright", "credits" or "license" for more information.
>>>>
>
>What's going on?

You mentioned linux.  Did you actually try this under linux?  Create a
directory called "Program Files", put an executable in the directory,
and try to do what you did.

bash barfs on linux, too.

So, your assumptions are wrong.  You probably need to quote "$py" for
things to work.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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