Warum stimmt was nicht mit dem Effekt überein, den ich bekomme?

264
WilliamKF

Ich kann das folgende Verhalten nicht erklären:

[centos4x64 ~] /usr/local/bin/gmake --version GNU Make 3.82 Built for x86_64-unknown-linux-gnu Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.  [centos4x64 ~] which gmake /usr/local/bin/gmake  [centos4x64 ~] gmake --version GNU Make 3.80 Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

Warum stimmt das unqualifizierte gmake nicht mit dem angegebenen Wert überein which? Beachten Sie, dass ich in / usr / bin / gmake v3.80 installiert habe. Dies ist in bash auf einer 64-Bit-Version Centos 4.

1

1 Antwort auf die Frage

2
Ignacio Vazquez-Abrams

Weil sich bash an gmakeeiner anderen Stelle in seiner Hash-Lookup-Tabelle befindet.

# list the path to the binary that invoking 'gmake' will call hash -t gmake  # have bash forget the mapping for 'gmake' hash -d gmake # have bash remember the correct mapping for 'gmake' hash -p /usr/local/bin/gmake gmake # or just gmake