Skip to content

Instantly share code, notes, and snippets.

@HayatoDoi
Last active June 13, 2017 09:58
Show Gist options
  • Save HayatoDoi/5c3e50cabe388251fc73933061afeddd to your computer and use it in GitHub Desktop.
Save HayatoDoi/5c3e50cabe388251fc73933061afeddd to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
function fullpath (){
f=$@;
if [ -d "$f" ];then
base="";
dir="$f";
else
base="/$(basename "$f")";
dir=$(dirname "$f");
fi;
dir=$(cd "$dir" && /bin/pwd);
echo "$dir$base"
}
echo "explorer.exe "$(fullpath $1) |
sed -e "s/\/mnt\/c/C:/g" |
sed -e "s/\//\\\\\\\\/g" |
sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment