Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

@LXPATH

May
12,957
172
I'm playing with this (improvements welcomed).

Code:
v:\> function lxpath `'%@rereplace["([a-zA-Z]):",/mnt/%%@lower[\1],%@rereplace[\\,/,%$]]'`

It works like this.

Code:
v:\> echo %@lxpath[D:\WoRk\AbC\DeF\FoO.TxT]
'/mnt/d/WoRk/AbC/DeF/FoO.TxT'

Apparently (I'd like to know more about this) file names and directory names inside /mnt/<windows_drive_letter> are case-insensitive (not the drive letter itself). So these work.

Code:
v:\> type d:\work\abc\def\foo.txt
foo

v:\> wsl cat %@lxpath[d:\WoRk\AbC\dEf\FoO.TxT]
foo

v:\> wsl cat %@lxpath[d:\work\abc\def\foo.txt]
foo

Is that useful?
 
Back
Top