ATN
ATN

Reputation: 665

cygpath doesn't convert Windows path correctly

command line shell

echo %PIG_HOME%
C:\cygwin\usr\lib\pig

cygwin

echo $PIG_HOME
C:\cygwin\usr\lib\pig

echo $( cygpath -u "$PIG_HOME" )
/usr/lib/pig

cd $( cygpath -u "$PIG_HOME" )
-bash: cd: /usr/lib/pig: No such file or directory

Question: why is cygpath not converting it to /cygdrive/c/cygwin/usr/lib/pig?

UPDATE:

The path to the pig folder is correct.

command line shell

C:\Users\john.doe> cd %PIG_HOME%
C:\cygwin\usr\lib\pig>

cygwin

john.doe@COMPUTER ~
$ cd /cygdrive/c/cygwin/usr/lib/pig/

john.doe@COMPUTER /cygdrive/c/cygwin/usr/lib/pig
$

Upvotes: 2

Views: 8610

Answers (3)

user7499251
user7499251

Reputation: 11

Did you try option "-m, --mixed : like --windows, but with regular slashes (C:/WINNT)"

$ cd /cygdrive/c/cygwin64/home
$  cygpath -m $(pwd)
C:/cygwin64/home

Upvotes: 0

Zombo
Zombo

Reputation: 1

With Cygwin,

C:\cygwin\lib\pig = /usr/lib/pig

and

C:\cygwin\usr\lib\pig = /cygdrive/c/cygwin/usr/lib/pig

This setup is by design.

The C:\cygwin\usr\lib folder is not created by any packages and should not be created by you either.

Upvotes: 2

stringsn88keys
stringsn88keys

Reputation: 948

Type mount in your terminal window.

My c:\cygwin\bin and c:\cygwin\lib\ are mounted at /usr/bin and /usr/lib respectively. I suspect that your c:\cygwin\usr\lib is mounted at /usr/lib.

Therefore, the "unix" path to c:\cygwin\usr\lib\pig would be /usr/lib/pig.

Upvotes: 0

Related Questions