- May
- 13,828
- 211
I'm playing with this (improvements welcomed).
It works like this.
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.
Is that useful?
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?