The below script creates pre_build files for as many files* it finds in the directory. The problem is that if there are more than 9 files it stops. How can I make it keep going? Sometimes there may be different amounts.
#!/bin/ksh
for i in *file*
do
outFile=$(echo ${i} | sed -e 's/.*\([0-9][0-9]*\)$/pre_build\1/g');
# echo "file->[${i}] outFile->[${outFile}]"
cat pre_master_build > ${outFile}
done;
#!/bin/ksh
for i in *file*
do
outFile=$(echo ${i} | sed -e 's/.*\([0-9][0-9]*\)$/pre_build\1/g');
# echo "file->[${i}] outFile->[${outFile}]"
cat pre_master_build > ${outFile}
done;