Grep for pattern recursive and disable file On a shared host, I'd like to setup a cron which scans folders recursively for some base64 malware strings. Therefore, I've written the following script:

#!/bin/bash

if [ $# -ne 1 ]; then
    echo $0: usage: ./findone folder_to_start_with
    exit 1
fi

folder=$1

IFS=$'\n'
searchfiles=($(grep -r -F -n -f malware-strings.dat $folder))

for (( i=0; i&lt;${#searchfiles[@]}; i++ ));
        do
                STR=$(echo ${searchfiles[i]} | awk -F':' '{print $1}')
                    if [ -z "$STR" ]; 
                        then true; 
                        else chmod 000 $STR;
                    fi            
        done

## Do something else like mail results etc.
printf '%s\n' "${searchfiles[@]}"


My locals test are doing what I expect. If a string pattern from "malware-string.dat" is found the file permission is changed to 000. Before scanning the production sites, I wanted to ask for a code review as I'm new to Bash and do not want to mess things up. Also, your judgement of disabling the file with chmod is enough would help, or if it is advisable to move the file outside of the www directory.
Bash idiom for looping over searchfiles is

for file in $searchfiles; do
    process "$file"

Invoking awk just to print a field looks like an overkill. Consider

read -d : str rest &lt;&lt;&lt; "$file"