I'm looking for a way to translate Win32 paths into POSIX paths, preferably using Win32 tools.
Background
The latest Windows 10 Insider Build introduced the Windows Subsystem for Linux (WSL) including a native bash
provided by Canonical, the company behind Ubuntu. Their implementation of bash
goes by the rather complicated name of Bash on Ubuntu on Windows, which I will refer to as bash.exe
in the following.
The equivalent of accessing the Windows path C:\Users\me\Desktop
in bash.exe
is /mnt/c/Users/me/Desktop
.
I'm trying to pass a path to bash.exe
from the Windows Command Prompt (e.g. bash -c ls /mnt/me/Desktop
). Since that requires me to pass a POSIX path, I was wondering if Microsoft offers any tools to translate Win32 paths programmatically into POSIX paths (like cygpath
does in Cygwin, or winepath
on Wine)
Alternatives
Unless Windows ships with any tools for translation, I'm open to alternatives to determine the path, e.g. using Node or Python.