Cygwin C: / Program: No such file or directory

After upgrading from Windows 7 to Windows 10, I installed Cygwin again. When I run from Cygwin I get the following error:

/ cygdrive / c / Cygwin64 / bin / sh: C: / Program: No such file or directory

Any idea what this could be related to?

+3


source to share


1 answer


This is the result of spaces in Windows file or directory names.

To properly diagnose the problem, you will need to specify the exact command you are entering and the value of the cygwin PATH variable, for example. echo $PATH

...



Typically, this issue is fixed by quoting shell commands, so the shell does not separate path names in spaces in the file path. You add double or single quotes around literal file paths eg. '/cygdrive/c/Program Files/...'

and double quotes around variable references, eg. "$FileName"

in shell commands and scripts.

When you install or reinstall cygwin, it is very important not to install in a directory with a space in its path name, not to use eg. C:\Cygwin 64

; use C:\Cygwin64

or instead C:\Cygwin_64

. If you've installed a path like this, your best bet is to uninstall that installation and reinstall to a path without a space.

+4


source







All Articles