Skip to content

Instantly share code, notes, and snippets.

@hashchange
hashchange / wsl-linux-path
Last active August 11, 2022 17:51
Safely converts a Windows path to a WSL (Linux) path. Does not suffer from the limitations of `wslpath -u`.
#!/usr/bin/env bash
# Script name
PROGNAME="$(basename "$BASH_SOURCE")"
if [[ "$1" == '--version' || "$1" == '-v' ]]; then
fmt -s <<- VERSION_TEXT
$PROGNAME 1.0.1
(c) 2022 Michael Heim
License: MIT