I have a directory on my PATH that contains a subdirectory named "gcc". When I run "gcc" (not fully-qualified) I get all sorts of very bizarre behavior. For example: $ cat t.c #include <limits.h> $ mkdir gcc $ PATH=.:$PATH gcc -E t.c >/dev/null In file included from /tmp/t.c:1: /usr/include/limits.h:125:26: error: no include path in which to search for limits.h But, if I don't have a local directory "gcc" then all is fine: $ rmdir gcc $ PATH=.:$PATH gcc -E t.c >/dev/null $ If I use a fully-qualified path for GCC (/usr/bin/gcc) then it also does not fail. It looks to me like the test GCC performs when looking for itself through PATH just checks for executability (if I have a non-executable file in a directory on PATH this doesn't happen) but doesn't check for directory-ness. This is wrong, because the shell's PATH search algorithm DOES check for directory-ness and skips directories that appear in directories on your PATH.
*** This bug has been marked as a duplicate of 38966 ***
Ah, thanks for the pointer. I did search before I created a new bug but wasn't successful in narrowing down my search to something reasonable. It would be nice if the "real" bug mentioned PATH in the summary; I was trying to use case-sensitive searches for PATH but searching comments turned up >150 bugs.