Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 396
Guillaume Avatar asked Dec 02 '10 11:12

Guillaume


People also ask

How do I add a PATH in Cygwin?

From the Start menu, select Parameters > Control Panel > System. Select the Advanced tab and click Environment variables. Edit the PATH environment variable to add the Cygwin installation directory, for example c:\cygwin\bin; and click OK.

Can Cygwin access Windows files?

I.e. DOS C: drive can be accessed in Cygwin by /cygdrive/c, D: as /cygdrive/d, etc. To display the contents of the current directory, you can use ls or dir commands. ls -la will provide more details, including file access permissions, size and modification date.

What is PATH Cygwin?

The PATH environment variable is used by Cygwin applications as a list of directories to search for executable files to run.

Where does Cygwin store files windows?

The Cygwin DLL supports user specific fstab files. These are stored in the directory /etc/fstab. d and the name of the file is the Cygwin username of the user, as it's created from the Windows account database or stored in the /etc/passwd file (see the section called “Mapping Windows accounts to POSIX accounts”).


1 Answers

This works:

$ winhome="/cygdrive/c/Documents and Settings/" $ cd "$winhome" $ pwd /cygdrive/c/Documents and Settings 
like image 100
RobS Avatar answered Sep 28 '22 19:09

RobS