2 avoid problems with filenames containing `=`.
source | link

Here's a POSIX-compliant way, in case you don't have grep -L:

for file in *; do
    awk '/string/ { found=1; exit } END{ if(!found) { printf "x" } }' < "$file"
done | wc -c

Here's a POSIX-compliant way, in case you don't have grep -L:

for file in *; do
    awk '/string/ { found=1; exit } END{ if(!found) { printf "x" } }' "$file"
done | wc -c

Here's a POSIX-compliant way, in case you don't have grep -L:

for file in *; do
    awk '/string/ { found=1; exit } END{ if(!found) { printf "x" } }' < "$file"
done | wc -c
    Post Undeleted by Chris Down
    Post Deleted by Chris Down
    Post Undeleted by Chris Down
    Post Deleted by Chris Down
1
source | link

Here's a POSIX-compliant way, in case you don't have grep -L:

for file in *; do
    awk '/string/ { found=1; exit } END{ if(!found) { printf "x" } }' "$file"
done | wc -c