bmatzelle / gow

Unix command line utilities installer for Windows.
https://github.com/bmatzelle/gow/wiki
6.55k stars 363 forks source link

GNU which v2.20 from gow v0.8.0 cannot find "C:\Windows\System32\OpenSSH\ssh.exe" #276

Open sebma opened 1 year ago

sebma commented 1 year ago

Hi,

GNU which v2.20 from gow v0.8.0 cannot find C:\Windows\System32\OpenSSH\ssh.exe :

> C:\ProgramData\scoop\apps\gow\0.8.0\bin\which.exe -v
GNU which v2.20, Copyright (C) 1999 - 2008 Carlo Wood.
GNU which comes with ABSOLUTELY NO WARRANTY;
This program is free software; your freedom to use, change
and distribute this program is protected by the GPL.
> C:\ProgramData\scoop\apps\gow\0.8.0\bin\which.exe ssh
C:\ProgramData\scoop\apps\gow\0.8.0\bin\which.exe: no ssh in (.;C:\ProgramData\scoop\apps\gsudo\current;C:\ProgramData\scoop\shims;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH;C:\ProgramData\chocolatey\bin;C:\Users\sebastien.mansfeld\AppData\Local\Microsoft\WindowsApps)

Although C:\Windows\System32\OpenSSH it is in the PATH variable :

> $env:path -split ';' -match "ssh"
C:\windows\System32\OpenSSH

But the whereis.bat tool finds it :

> C:\ProgramData\scoop\apps\gow\0.8.0\bin\whereis.bat ssh
C:\Windows\System32\OpenSSH\ssh.exe

However which works fine with other arguments :

> C:\ProgramData\scoop\apps\gow\0.8.0\bin\which.exe where which choco
C:\windows\system32\where.EXE
C:\ProgramData\scoop\shims\which.EXE
C:\ProgramData\chocolatey\bin\choco.EXE

And the PATH variable is :

> $env:path -split ';'
C:\ProgramData\scoop\apps\gsudo\current
C:\ProgramData\scoop\shims
C:\windows\system32
C:\windows
C:\windows\System32\Wbem
C:\windows\System32\WindowsPowerShell\v1.0\
C:\windows\System32\OpenSSH
C:\ProgramData\chocolatey\bin
C:\Users\sebastien.mansfeld\AppData\Local\Microsoft\WindowsApps

>
BrBill commented 1 year ago

Seconded; which is broken.

lm8 commented 10 months ago

I have a working which implementation written from scratch in C.