0
我想要做以下動作如何在Java中迭代文件?
for(File : find - ".java"){
// here i will do grep on the file, i want to process each file separetely
}
有什麼辦法在bash做到這一點?
我想要做以下動作如何在Java中迭代文件?
for(File : find - ".java"){
// here i will do grep on the file, i want to process each file separetely
}
有什麼辦法在bash做到這一點?
只需使用一個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")