Cygwin: using a path variable containing a windows path (with a space in it)

I want to add some dirs to my PATH. Unfortunately these dirs are located in windows path containing space (like the Documents and Settings)

I've unsuccessfully tried to:

Create a variable:

43598811@E250BZD20015026 ~
$ winhome="/cygdrive/c/Documents\ and\ Settings/43598811/"

43598811@E250BZD20015026 ~
$ cd $winhome
bash: cd: /cygdrive/c/Documents\: No such file or directory    

43598811@E250BZD20015026 ~
$ cd "$winhome"
bash: cd: /cygdrive/c/Documents\ and\ Settings/43598811/: No such file or directory

Create an alias:

43598811@E250BZD20015026 ~
$ alias winhome="/cygdrive/c/Documents\ and\ Settings/43598811/"

43598811@E250BZD20015026 ~
$ winhome
bash: /cygdrive/c/Documents and Settings/43598811/: is a directory

43598811@E250BZD20015026 ~
$ cd winhome
bash: cd: winhome: No such file or directory

Use a soft link: it is working... but I don't want to use this

Any suggestion ?

Answers


This works:

$ winhome="/cygdrive/c/Documents and Settings/"
$ cd "$winhome"
$ pwd
/cygdrive/c/Documents and Settings

Need Your Help

Dynamic jQuery Selectors, variable problem

jquery

I'm just trying to make a list of questions with hidden answers that shows upon click. My code hides all divs, but when I click on the anchors, only the last box is toggled. In this case, every an...

append table row after every fifth row using javascript/jQuery

javascript jquery append tablerow

I need to append a table row count after every 5th row in a table. How can I do this without using server side programming? jQuery or regular javascript is fine!