Script to Scan proclog files

i need to create a shell script, which will go into a directory , and scan the files in it for defined errors, there will be around 10 files in the directory.

This will work for you...

#!/usr/bin/ksh
for file is `ls directoryname`
do
echo $file
cat $file | grep -i "error pattern" >newfile
done


ls Dir_name | xargs grep "error_pattern"

If u are having multiple error patterns use -e option

Thanks
penchal

grep "error pattern" *