Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cygwin C:/Program: No such file or directory

Tags:

cygwin

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 ?

like image 258
entrypass Avatar asked Jul 03 '17 17:07

entrypass


1 Answers

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.

like image 157
Doug Henderson Avatar answered Oct 16 '22 14:10

Doug Henderson