This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Spaces in Environment Variables
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Sat, 27 Aug 2005 14:52:34 -0700
- Subject: Re: Spaces in Environment Variables
- References: <20050827213817.79719.qmail@web52805.mail.yahoo.com>
- Reply-to: cygwin at cygwin dot com
Jesse Hogan wrote:
> $ PF="/cygdrive/c/Program\ Files"
> $ export PF
> $ cd $PF
> : cd: /cygdrive/c/Program\: No such file or directory
> $ ls $PF
> ls: /cygdrive/c/Program\: No such file or directory
> ls: Files: No such file or directory
You are simultaneously overquoting and underquoting. When you assign a
value to PF you need to use either quotes or backslash-escapes, but not
both. When you 'cd' you need to quote the argument if it contains
spaces.
$ export PF="/cygdrive/c/Program Files"
$ cd "$PF"
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/