one way
while read -r folders
do
# add -maxdepth 1 if recursive traversal is not required
find "$folders" -type f -iname "*.txt" | while read -r FILE
do
echo "do something with $FILE"
done
done <"file"
or
folders=$(<file)
find $folders -type f -iname "*.txt" | while read -r FILE
do
echo "do something with $FILE"
done
Bash 4.0 (if recursive find is required)
shopt -s globstar
folders=$(<file)
for d in $folders
do
for file in $d/**/*.txt
do
echo "do something with $file"
done
done
ghostdog74
2010-02-25 05:09:19