This is the mail archive of the
mailing list for the cygwin project.
How create variables to hold directory names on Windows bash?
- From: "neal olander" <olanderfamily at hotmail dot com>
- To: cygwin-talk at cygwin dot com
- Date: Wed, 09 Mar 2005 07:09:00 -0800
- Subject: How create variables to hold directory names on Windows bash?
- Reply-to: Talk Amongst Yourselves <cygwin-talk at cygwin dot com>
I'm working on a PC running Windows XP. Using win-bash, but not CygWin. I'm
a long-time Unix programmer, so I'm trying to get bash workin on XP. But
I'm having tremendous problems with spaces in folder names. Finally
figured out how to "cd" to folders with spaces in names:
bash> cd "C:\Program Files" # fails
bash> cd "\Program Files" # works
After typing "Program Files" the 40th time I'm thinking it is time to store
the string "Program Files" in a string. I tried creating a variable and
declare pf="\Program Files"
cd $pf # fails due to spaces in variable name
QUESTION: In bash on Windows, how can I store directory names (containing
spaces) in variables so I can use them for "cd"?
Thanks in advance for any help,
PS: I"ve tried asking this question on the bash forum, but that is sort of
dormant and go no replies. I understand this is a Cygwin mailing list, so I
started with the "talk" mailing list, figuring I wouldnt bother people too