After migrating from Windows 7 to Windows 10, I re-installed Cygwin. When I run from Cygwin I'm getting following error:
/cygdrive/c/Cygwin64/bin/sh: C:/Program: No such file or directory
Any idea what this could be related to ?
This is the result of spaces in windows file or directory names.
To properly diagnose the problem, you will need to quote the exact command you enter, and the value of the cygwin PATH variable, e.g. echo $PATH
.
Typically, this problem is fixed by quoting shell commands so the shell does not split path names on the spaces within file paths. You add double or single quotes around literal file paths, e.g. '/cygdrive/c/Program Files/...'
, and double quotes around variable references, e.g. "$FileName"
in shell commands and scripts.
When you install or re-install cygwin, it is very important to not install to a directory with a space in its path name, do not use e.g. C:\Cygwin 64
; instead use C:\Cygwin64
or C:\Cygwin_64
. If you do install to such a path, your best bet is to delete that installation and reinstall to a path without a space in it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With