entrypass
entrypass

Reputation: 91

Cygwin C:/Program: No such file or directory

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 ?

Upvotes: 9

Views: 21892

Answers (1)

Doug Henderson
Doug Henderson

Reputation: 898

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.

Upvotes: 11

Related Questions