#!/bin/bash find / -name "*.php" > f=`cat ./` for n in $f do r=`egrep 'abc' $n` if [ ! "$r" = "" ] ; then echo $n fi done