#! /bin/bash

#############################################################################
#  Copyright (C) 2003  Enno Bartels   <ennobartels@t-online.de>             #
#############################################################################
#                                                                           #
#  This program is free software; you can redistribute it and/or            #
#  modify it under the terms of the GNU Library General Public              #
#  License as published by the Free Software Foundation; either             #
#  version 2 of the License, or (at your option) any later version.         #
#                                                                           #
#  This program is distributed in the hope that it will be useful,          #
#  but WITHOUT ANY WARRANTY; without even the implied warranty of           #
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        #
#  Library General Public License for more details.                         #
#                                                                           #
#  You should have received a copy of the GNU Library General Public        #
#  License along with this program; see the file COPYING.LIB.  If not,      #
#  write to the Free Software Foundation, Inc., 59 Temple Place -           #
#  Suite 330,  Boston, MA 02111-1307, USA.                                  #
#                                                                           #
#############################################################################
#                                                                           #
#  Project name.....  minolta_dimage_xt                                     #
#                                                                           #
#  Modul name.......  change_SpecCharaters.sh                               #
#                                                                           #
#  Starting dates...  11.Okt.2003 (Enno Bartels)                            #
#                                                                           #
#  Version..........  0.0.1                                                 #
#                                                                           #
#  Author...........  Enno Bartels <ennobartels@t-online.de>                #
#                                                                           #
#  Description......  Tool for the Minolta Dimage Xt Camera                 #
#                                                                           #
#############################################################################/


# Variablen
CHANGE_IN="\:"
CHANGE_OU="_"





##############################################################################
# In den HTML Seiten                                                         #
##############################################################################

echo "1. HTML Inhalte umbenennen"
BLA1=`find .  -name  "*.html"  -maxdepth 2 -print`
for FILENAME in $BLA1
do
  echo "  $FILENAME $FILENAME.tmp"
  sed "/href/s/${CHANGE_IN}/${CHANGE_OU}/g"  $FILENAME > $FILENAME.tmp && mv $FILENAME.tmp $FILENAME
  sed "/img/s/${CHANGE_IN}/${CHANGE_OU}/g"  $FILENAME > $FILENAME.tmp && mv $FILENAME.tmp $FILENAME
  echo 

done

echo "1. HTML Inhalte umbenennen  --  fertig"
echo 
echo 
echo 


##############################################################################
##############################################################################

echo "2. Dateien umbenennen"
BLA2=`find .  -name "*.*"  -maxdepth 2 -print`
for FILENAME_IN in $BLA2
do
  FILENAME_OUT=`echo $FILENAME_IN | sed "s/${CHANGE_IN}/${CHANGE_OU}/g"` 
  if test  $FILENAME_IN  != $FILENAME_OUT ; then
    echo "In : $FILENAME_IN"
    echo "Out: $FILENAME_OUT"
    echo 

    mv $FILENAME_IN  $FILENAME_OUT
  fi
done

echo "2. Dateien umbenennen  --  fertig"
echo 
echo 
echo 

##############################################################################
##############################################################################








