step i have to do is 1) EXECUTE ALL THE FILES by using the command dwarfdump <filename>| grep DW_AT_SUN_command_line
and put the output in one text file.instead of executing the files for all the 10 files .. can i read the files in the directory lib and pass the file name and print the filename and finally the output in the text file..?
i have idea about filtering the files with find ./ -name "*.ksh" -print
but what is the command for listing all the files without .ksh and .sql files..?
if you are want your script not to execute itself, try
ls /logfile/lib | while read filename
do
if [ ! -f dwarf_output.ksh ]; then
echo "STARTING THE FILE" $filename >>dwarf_output.txt
echo "*************************************">>dwarf_output.txt
dwarfdump $filename | grep DW_AT_SUN_command_line >>dwarf_output.txt
echo "END OF FILE " $filename >>dwarf_output.txt
fi
done
or
ls /logfile/lib | while read filename
do
if [ ! -f $0 ]; then
echo "STARTING THE FILE" $filename >>dwarf_output.txt
echo "*************************************">>dwarf_output.txt
dwarfdump $filename | grep DW_AT_SUN_command_line >>dwarf_output.txt
echo "END OF FILE " $filename >>dwarf_output.txt
fi
done