I have a directory with several subdirectories; in each of these, I have some files. I want to perform a grep only for some subdirectories to find those files that match the query and remove them; something like grep -rl --exclude-dir=dir1 --exclude-dir=dir2 HUMAN . | rm, but I'd prefer not to parse the stdin from grep.
I think I have to combine find and rm, but I don't know how.
Moreover, it seems that (at least here in Cygwin), I cannot do --exclude-dir={dir1, dir2}, I have to split them. This is a minor problem, but does someone have any idea why this doesn't work?