Two application types come to my mind where shell loops are not considered to be the best approach. The first is data processing; many tools (like
perl, etc.) do the loop implicitly and much more performant. The second is (like in your sample code), where some code is executed for a set of files, where
find with the
-exec switch can also already execute commands (also a shell) with less problems and overhead. There are probably more cases, but those two mentioned should already be enlightening. That said; shell loops are not inherently bad, or somesuch. Just take other options (like the two mentioned) into your consideration.