【发布时间】:2021-02-28 14:01:25
【问题描述】:
抱歉,其他问题对我没有帮助:/ 我想遍历一个目录以在某些文件上应用程序。 问题是它还包括子目录。 我的代码有什么问题?:
#!/bin/bash
for file in `find $path/* \( -name "*.txt" -o -name "*.out" \) -prune -maxdepth 1 -type f `;
do
program "$file" -outdir=$outdir;
done
【问题讨论】:
-
find的真正目的是遍历子目录。