45 lines
1 KiB
Text
45 lines
1 KiB
Text
|
# Date: 15th of March 2k+1
|
|||
|
# Last Changed: 24th of February 2k+4
|
|||
|
# Author: Nico Schottelius <Nico AT Schottelius DOT Org>
|
|||
|
# Description: This script searches for the following strings
|
|||
|
# and will substitute them with the right German Characters
|
|||
|
#
|
|||
|
# _ae_ = <20>
|
|||
|
# _ue_ = <20>
|
|||
|
# _oe_ = <20>
|
|||
|
# _Ae_ = <20>
|
|||
|
# _Oe_ = <20>
|
|||
|
# _Ue_ = <20>
|
|||
|
# _sz_ = <20> (not _ss_ like it was earlier)
|
|||
|
#
|
|||
|
|
|||
|
|
|||
|
if [ $# -lt 1 ]; then
|
|||
|
echo `basename $0`': file(s)'
|
|||
|
echo 'Hey, hey guy, what to convert ?'
|
|||
|
exit 1
|
|||
|
fi
|
|||
|
|
|||
|
for mfile in $@; do
|
|||
|
|
|||
|
if [ ! -f "$mfile" ]; then
|
|||
|
echo "Keine Datei namens $mfile gefunden. Skip."
|
|||
|
break
|
|||
|
fi
|
|||
|
|
|||
|
# something other programs do not use
|
|||
|
G_STR=".`date +%s%M%U`-`basename $0`-`basename $mfile`-$$"
|
|||
|
|
|||
|
echo "Using $G_STR to convert $mfile ..."
|
|||
|
|
|||
|
cat "$mfile" | sed -e 's/_ae_/<2F>/g' -e 's/_ue_/<2F>/g' -e 's/_oe_/<2F>/g' \
|
|||
|
-e 's/_Ae_/<2F>/g' -e 's/_Ue_/<2F>/g' -e 's/_Oe_/<2F>/g' -e 's/_sz_/<2F>/g' > "$G_STR"
|
|||
|
|
|||
|
if [ $? = 0 ]; then
|
|||
|
mv "$G_STR" "$mfile"
|
|||
|
else
|
|||
|
echo "Replacing failed, don't replace original."
|
|||
|
fi
|
|||
|
|
|||
|
done
|