How create variables to hold directory names on Windows bash?

neal olander olanderfamily@hotmail.com
Wed Mar 9 15:10:00 GMT 2005


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 
using it:

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,
neal


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 
much.




More information about the Cygwin-talk mailing list