The -execdir
flag is a feature of GNU find, and the way it's implemented is to throw that error and refuse to proceed if the situation it describes is detected. There's no option in find
to avoid that error. So, you can either fix PATH
(you can do that just for the find
command itself:
PATH=<fixed-path> find -maxdepth 2 -name 'Makefile' -print -execdir make \;
) or else don't use -execdir
as described by Basile.
Err... actually that's POSIX sh syntax. Does csh
support that? I haven't used csh
in so long that I can't remember, and honestly it's such a bad shell that I can't be bothered to go look :-p :-)