Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
cygwin cygdrive paths and Windows Command Prompt

I'm having a weird issue with cygwin acting inconsistently between installations, specifically scp. I have c:\cygwin\bin in my Windows PATH in both cases. When I run the following command from a Windows Command Prompt, however, I get very different results between the two installations:

scp /cygdrive/c/something.txt User@server:${HOME}/something.txt

On the one machine it transfers the file just fine, but on the other machine I get an error:

/cygdrive/c/something.txt: No such file or directory

However, if I execute the command this way on the machine that gave me the error, it transfers just fine:

scp /c/something.txt User@server:${HOME}/something.txt

Why the differences? Is there something I need to configure within cygwin to make this work with /cygdrive/c?

I've tried running mount --change-cygdrive-prefix /cygdrive but that doesn't fix the problem.

UPDATE: Here's something more interesting. If I do ls /c from a Windows command prompt I get what you would expect, as list of everything in C:. However, ls /cygdrive/c says that it doesn't exist. Running those commands from the cygwin bash yields exactly the opposite behavior.

share|improve this question
Have you ruled out different (non-Cygwin) versions of ls and scp, which you don't see from inside bash because it comes from Cygwin and puts Cygwin /bin ahead of PATH on startup? –  Gilles Sep 29 '10 at 0:06
post this as an answer and I'll get you some rep. This problem was fixed when I did set PATH=C:\cygwin\bin;%PATH% instead of `set PATH=%PATH$;C:\cygwin\bin. –  Matt Baker Sep 29 '10 at 0:14
You need to say @Gilles if you want someone to see a comment (unless it's attached to an answer or question of theirs). –  Dennis Williamson Sep 29 '10 at 0:29
Oops, may bad. Thanks @Gilles. If you post this as an answer I'll get you some rep. This problem was fixed when I did set PATH=C:\cygwin\bin;%PATH% instead of set PATH=%PATH$;C:\cygwin\bin –  Matt Baker Sep 29 '10 at 0:46
add comment

marked as duplicate by studiohack Aug 31 '11 at 18:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 2 down vote accepted

It looks like your scp and ls commands are not Cygwin versions. Presumably, you start bash, your startup scripts change the PATH to put the Cygwin /bin in front, whereas otherwise your PATH has non-Cygwin versions of scp and ls early on.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.