Last active
May 26, 2018 03:37
-
-
Save gazpachoking/49eeaa47eed0ae2b295522b7fe17061b to your computer and use it in GitHub Desktop.
Allows easy use of Windows environment variables from within Windows subsystem for Linux (using fish shell.) Automatically translates variables that look like Windows paths to WSL paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function winenv --description "Echos windows environment variables from WSL." | |
for arg in $argv | |
set result (cmd.exe /c echo "%"$arg"%" | string trim) | |
if echo $result | grep -i "^[a-z]:\\\\" > /dev/null | |
for r in (echo $result|string split ";") | |
echo (wslpath $r) | |
end | |
else | |
echo $result | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This function allows easier use of Windows environment variables from the fish shell in WSL. Examples: