shell script to auto process ten random files and generate logs

Hello member's

I'm learning to script in the ksh environment on a Solaris Box.

I have 10 files in a directory that I need to pass, as input to a batch job one by one. lets say, the files are named as follows:
abcd.txt ; efgh.bat ; wxyz.temp etc. (random filenames with varied extensions ).

How do I go about achieving the following :

I want my batch script to take one file at a time from the current directory and process it, redirect the console output to a logfile (log1.txt, log2.txt etc )

./batch_script.ksh > log1.txt -- likewise, create 10 log files and exit

for simplicity sake, contents of the script:
#! /bin/ksh

mv abcd.txt ./temp/
echo "test script"

### End of Script ####

Sorry if i sound vague. My problem definition is so silly, that I haven't managed to put it into simple words to explain my requirement better.

regards,

Kris

Hi,


#!/bin/sh
for filename in `ls`
do
        echo "$filename"
        #process this file using your script and print the output on the log file
done