脚本
#!/bin/bash
for file in $1/*.h
do
timespec=`strings $file | grep "struct timespec {"`
if [ -n "$timespec" ]; then
echo $file
# echo $file: $timespec
fi
done
执行
搜索 /home/guol 下所有包含 struct timespec { 的头文件:sh iterate.sh /home/guol
最后
以上就是从容音响最近收集整理的关于shell脚本-遍历指定目录文件,找出包含指定内容的文件的全部内容,更多相关shell脚本-遍历指定目录文件,找出包含指定内容内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复