0
Is there a concise way to call the "other" executable for find
available in path that can be found with where
?
C:\repos>where find
C:\Windows\System32\find.exe
C:\Program Files\Git\usr\bin\find.exe
C:\Users\Qwerty\cmd\UnxUtils_wbin\find.exe
For example something like find~2
or wannabe whereget find -n 2 -- <arguments for find here>
The alias won't work either in a bash script. – xenoid – 2019-04-10T14:22:45.323
Interesting, it only works in the active console. Would you mind clarifying why? @xenoid – Qwerty – 2019-04-11T07:41:08.570
1Because when you run a script, it's a new bash instance in which the alias is not defined (only properly exported environment variables are inherited from the parent). If your "source" the file, it is run in the same bash instance, and the alias is used. And I don't see a way to define the alias for a script, since on the interactive bash instances read the profile files (
.bashrc
and.bash_profile
). – xenoid – 2019-04-11T09:58:18.880Right, then I will put it to
~/.bashrc
file – Qwerty – 2019-04-11T11:21:32.410won't work, because, as I said .bashrc is only used by interactive shells. It is not run by instances of
bash
that are started to run scripts. And you can't use functions for the same reason. – xenoid – 2019-04-11T11:48:32.787