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")