This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: spaces in paths in bash, and the FAQ


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]