I've seen various topics on how to iterate through multiple file extensions, but in most cases the list is defined.
example:
for file in ${arg}/**/*.{txt,h,py}
do
....
done
As can be seen, .TXT files would be ignored. And sadly, the guy who answered it says it only works for bash4. Mavericks is using bash 3.x
Any ideas on how it can be done on OS X?
Best Answer
Use
find
:Use
IFS= read -r
if the paths can end with spaces or contain backslashes.Or install bash 4:
Then:
shopt -s nocaseglob
also works with bash 3.2.