找出文件中包含指定字段的文件的shell脚本
发布时间:2016-12-26 来源:查字典编辑
摘要:复制代码代码如下:#!/bin/bashfind/-name"*.php">list.txtf=`cat./list.txt`fornin$...
复制代码 代码如下:
#!/bin/bash
find / -name "*.php" > list.txt
f=`cat ./list.txt`
for n in $f
do
r=`egrep 'abc' $n`
if [ ! "$r" = "" ] ; then
echo $n
fi
done