file=$(find /root -maxdepth 2 -type f)
OLD_IFS="$IFS"
IFS=" "
arr=($file)
IFS="$OLD_IFS"
for s in ${arr[@]}
do
if [ $(cat$s | grep "abcdefghijklmn") ] ;then
echo"$s"
fi
done
转载于:https://my.oschina.net/HankCN/blog/116124
file=$(find /root -maxdepth 2 -type f)
OLD_IFS="$IFS"
IFS=" "
arr=($file)
IFS="$OLD_IFS"
for s in ${arr[@]}
do
if [ $(cat$s | grep "abcdefghijklmn") ] ;then
echo"$s"
fi
done
转载于:https://my.oschina.net/HankCN/blog/116124