#!/bin/zsh

function rename_1 (){
  from=$1
  to=$2
  mv $from $(echo $to | tr '[A-Z]' '[a-z]').html
}

function rename_2 (){
  from=$1;
  to=$2
  mv $from "$(echo $to | tr '[A-Z]' '[a-z]').html"
} 


for f in *.HTM; do
  base=`basename $f .HTM`
  rename_2 $f $base
done

