cout­ing with fixed dig­its inside bash­scripts through string manipulation

#!/bin/bash
COUNT=0
while [ $COUNT -le 10000 ]
 do
     echo 000$COUNT |\
     rev |\ 
     cut -c 1-4 |\ 
     rev
     COUNT=`expr $COUNT + 1`
 done
 exit 0;

print a num­ber of zeros + the coun­ter­vari­able (948 -> 00948)
revert this string (00948 -> 84900)
select first e.g. four dig­its (84900 -> 8490)
revert the string (8490 -> 0948)

This was before i learned about zero padding file­names.
But as we all know, there is more than way to do it ;)