TIL escaping things for cmd.exe is sometimes impossible
like, if you have a file:
C:\folder with spaces (And parens)\fancy!!! chars'`@;,[]{}().txt
the only way to get that escaped as a subshell in bash is like:
cat "$(wslpath $'C:\\folder with spaces (And parens)\\fancy!!! chars\'`@;,[]{}().txt')"
and i'm trying to write something that will throw this into bash.exe -ic, but how the heck do you escape it?
backslashes won't do it, carets don't do it
looking it up, turns out you can't??
i did figure out a way to do it though! and that way is very bad, hee
i base64 the whole command line, and run it in a subshell, because that doesn't require any double-quotes or escaping magic cmd-side
always happy to come across another situation that's "not such a big deal because it's simply a contrived problem which you'll likely never encounter."
it's unfortunate that i'm relying on base64 existing in any wsl that this is used in, but i guess i'm already relying on bash as it is anyway, soooo....