cygpath -u doesn't seem to convert spaces properly
Wed Sep 26 00:18:00 GMT 2007
It seems to be a quoting problem. This is what I was doing:
$ ttt="$(cygpath -u "$JAVA_HOME")"
$ echo $ttt
$ cd $ttt
bash: cd: /cygdrive/c/Program: No such file or directory
$ cd "$ttt"
Is is possible to setup the variable to not require the double quotes?
Since my other method doesn't require the double quotes, it would
make the scripting much easier. I wouldn't need to keep track of which
variables I had to double quote.
$ tttt="$(cygpath -u "$(cygpath -m -s "$JAVA_HOME")")"
$ echo $tttt
$ cd $tttt
Notice that I can use $tttt directly without have to use the double quote.
Jerome Fong wrote:
> I am trying to use cygpath -u to convert my windows path to an unix path
> in my shell script. However, it has problems with paths that has spaces
> in it. For example, "cygpath -u c:\Program Files\Java" is converted to
> /cygdrive/c/Program Files/Java, which doesn't work. Is there a flag
> that I am missing?
> I came up with the following, but it seems wrong.
> $ cygpath -u "$(cygpath -m -s "c:\Program Files\Java")"
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
More information about the Cygwin