#!/bin/bash # conv () { mv $1 $1.tmp iconv --verbose -f ISO8859-1 -t UTF-8 $1.tmp > $1 rm -f $1.tmp } process () { if [ -f $1 ] then conv $1 fi if [ -d $1 ] then for filename in $1/* do process $filename done fi } process $1