我想做以下行动
for(File : find - ".java"){
// here i will do grep on the file, i want to process each file separetely
}
在bash中执行此操作的方法是什么?
答案 0 :(得分:2)
只需使用process substitution:
while IFS= read -r name;
do
# do things with $name, which contains the name of the file
done < <(find -type f -name "*.java")