#makeall
cd /u3/cpictest/src
for subdir in `find . -type d -print`
do
{
cd /u3/cpictest/src/$subdir
make -u
rm -rf *.o
}
done
#findall
cd /u3/cpictest/src
for subdir in `find . -type d -print`
do
{
cd /u3/cpictest/src/$subdir
grep $1 *
}
done

博客展示了两段Shell脚本代码。一段是'makeall'脚本,遍历指定目录下的子目录,执行'make -u'并删除'.o'文件;另一段是'findall'脚本,遍历子目录,在其中查找包含指定内容的文件。

被折叠的 条评论
为什么被折叠?



