This is the mail archive of the cygwin-talk@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]
Other format: [Raw text]

How create variables to hold directory names on Windows bash?


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.




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