Hi,
        I have the following code repeated for about 100
        directories, and in each directory there are about
        200 files:

cd /directory
for file in *
do
         if [ -f $file ] ; then
         echo -e "From - `date +%c`" >> Misc
         cat $file >> Misc
         rm -f $file
                 echo "" > /tmp/.misc
fi
done

        Whenever I run this script, CPU's, and other
        resources' usage goes up to 90-99%.  Since this
        operation is done on total of over 20000 files, I'd
        like to see if there is anything I can do to speed it
        up a little.
        
        As some probably detected by syntax, script is for
        bash shell; for this particular script, is there a
        better choice of interpreter?
        
         
Any advise is greatly appreciated.

Nikita.


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to