I'm searchinsearching for all files that containscontain one of thosea set of strings. If they do i, I change their access rights.
find . -type f -exec grep -q '#!/bin/bash\|#!/usr/bin/grep\|#!/usr/bin/awk' {} \; -exec chmod 700 {} ;\
I'm curious how the find works when it finds a file containing that string grep -q gives me 0 so another exec executes but should not that. That second exec findfinds all files and change the rights to all files ?. Why does it workswork and change it only tothose files containing that string.?