Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

These path shenanigans get even trickier when invoking WSL or Cygwin.

Here's an alias from my Cygwin .bashrc (which took me way too long to figure out) where both the *nix and Windows style paths are invoked:

alias ms='/cygdrive/c/Windows/System32/OpenSSH/ssh.exe -A -i 'C:\Users\me\.ssh\mm-id_rsa' me@myserver'



Or MSYS2. Other tricky variants is using Windows commands (which typically use '/' as option marker), e.g.

  $  tasklist /V
  ERROR: argument/option invalid - "C:/msys64/V"
or the time I wanted to use xmlstarlet and any xpath expression was interpreted as Windows path :(

At least for MSYS2 the environment variable MSYS2_ARG_CONV_EXC can be used to prevent conversion. https://www.msys2.org/docs/filesystem-paths/#process-argumen...


I believe it’s because it’s executing a Windows program (ssh.exe) located in Cygwin’s mount for your C: drive and that program therefore expects Windows-style paths.


I know now :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: