Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cygwin 'cd' command always tells me "No such file or directory"

Tags:

bash

path

cd

cygwin

When i login to the cygwin terminal and type:

cd "cygdrive/c/existing/path"

it tells me, "no such file or directory". i am sure the path exists... do i miss a special cygwin package, or do i have a false configuration? i am puzzled...

It behaves the same when i try to call the cygwin bash from a windows batch file. what i basically want to do is creating a windows batch file which starts cygwin and executes a shell script with a specified working directory as its described in this blog post: http://blog.dotsmart.net/2011/01/27/executing-cygwin-bash-scripts-on-windows/

my batch file seems to work, it does the following command:

%_CYGBIN%\bash.exe --login "cd %_CYGPATH%" "./%_CYGSCRIPT%"

but cygwin won't execute the 'cd' command. The console output of my batch file is:

/usr/bin/bash: cd /cygdrive/c/existing/path: No such file or directory
like image 709
thalm Avatar asked May 22 '13 16:05

thalm


1 Answers

cd '/cygdrive/c/existing/path'
#   ^
#    \
#     --- need forward slash (/) before the "c"
like image 151
2 revs Avatar answered Oct 09 '22 17:10

2 revs