#!/bin/bash # bash while loop # number to start with to call the original files (usually not changed) COUNT=1 # number to start with to name the new files (usually not changed) COUNT2=1 # total number of original files OTOTAL=250 # total number of end files ETOTAL=1000 # loop to call up the files to process. repeatedly calls up files numbered from 001 to $OTOTAL in accending order while [ $COUNT -le $OTOTAL ]; do if [ $COUNT -lt $OTOTAL ]; then VAR=`printf "%03d" $COUNT` elif [ $COUNT -eq $OTOTAL ]; then COUNT=0 VAR=$OTOTAL fi let COUNT=COUNT+1 #Limits the number of times files are called up to the variable $etotal. names the output files up to 9999 if [ $COUNT2 -le $ETOTAL ]; then VAR2=`printf "%04d" $COUNT2` elif [ $COUNT2 -gt $ETOTAL ]; then break fi let COUNT2=COUNT2+1 echo $VAR done