Large variable in bash script, is it wise?
Hello,
in my script i need to find newly added files added accross server HDD and check if they contains certain phrasses (30 phrasses)
so i made something like following code, but i dont know if its wise that find command in variable (it can match like tens of thousand file paths..), or how would you do it better to be less performance hungry..? thank you
for filepath in $(find /home ***);do
for phrasse in $(cat phrasses);do
grepout=$(grep ***)
if [[ "$grepout" == *"some phrasse"* ]];then
echo "phrasse found in $filepath"
fi
done
done