On Thu, Nov 28, 2019 at 4:18 PM Daniel Shahaf <d...@daniel.shahaf.name> wrote:
> Yasuhito FUTATSUKI wrote on Fri, Nov 29, 2019 at 00:15:48 +0900: > > Hi, while I do 'make distclean', I find odd `find' usage. > > > > In Makefile.in: > > > gcov-clean: > > > rm -f gcov-lcov.dat gcov-lcov.log gcov-genhtml.log > > > rm -rf gcov-report > > > find . -name "*.gcda" -o -name "*.gcno" -exec rm -f -- {} \; > > > > Is it intended below ? > > find . \( -name "*.gcda" -o -name "*.gcno" \) -exec rm -f -- {}\; > > I believe so, yes. Good catch. > > > I also want to insert `-name ".svn" -prune -or ' to avoid searching > > files into metadata directory in working copy, for I can find it > > because it takes long time to execute gov-clean target on my jalopy > > computer :) > > Is -prune portable? I don't see it in the POSIX spec of find(1). Where did you look? This page mentions -prune and even provides an example: https://pubs.opengroup.org/onlinepubs/009695399/utilities/find.html If you don't trust -prune then there's the following rather lengthy debate (rather than a clear cut answer) on stack exchange: https://stackoverflow.com/questions/4210042/how-to-exclude-a-directory-in-find-command Nathan