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 batchjob 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: Code:
#! /bin/ksh Kris |
I'd use a wrapper and do something like this
for i in $(ls); do ./$i done That should run every file in the current directory |
Or maybe
Code:
for i in $(ls); do |
Quote:
That was exactly what I was looking for. Kris |
concept:
Code:
FILES=(<put 10 files here>) |
All times are GMT -5. The time now is 07:21 PM. |