Reputation: 21
I am using perl under cygwin to run imagemagick and LaTeX. For various reasons, I must run pdflatex under cygstart. I have a path with spaces in the cygstart command, and only run this correctly with a windows path without space
cygstart c:/stuff/pdflatex.exe c:/Users/mainho~1/Pictures/6-13/directory.tex
mainho~1" is the 8char form of "main home computer
I would like a perl or unix function which would take
/cygdrive/c/Users/main\ home\ computer/Pictures/6-13/directory.tex
and would return
c:/Users/mainho~1/Pictures/6-13/directory.tex
Upvotes: 0
Views: 1151
Reputation: 342
Bash:
cygpath -m '/cygwin/c/Users
would return
c:/Users
. -m
stands for "mixed" meaning that forward slashes are used with volume identifiers.
If you launch it without shell you should drop single quotes.
I do not remember whether using single quotes makes same difference in Perl, try it yourself.
Upvotes: 0
Reputation: 22074
You can use cygpath
command in a shell to convert between both formats of paths
Convert from Windows path to unix.
cygpath "D:\\tmp"
Note that I use double backslashes because it needs to be escaped as it has a special meaning.
Convert from unix to Windows
cygpath -w "/usr/bin"
Upvotes: 1