for i in `find . -type f` do file $i | grep text 1>/dev/null 2>/dev/null if [ $? -eq 0 ] ; then grep -n "rm -rf %ORACLE_HOME%/jdk" $i 1>>found.log 2>/dev/null if [ $? -eq 0 ] ; then echo "String found in file ($i)" | tee -a found.log echo " " | tee -a found.log fi fi done