nsbin/latex_to_ae

46 lines
1 KiB
Text
Raw Normal View History

2006-07-20 07:54:37 +00:00
# Date: 03rd of August 2004
# Last Changed: 03rd of August 2004
# Author: Nico Schottelius <nico-linux@schottelius.org>
# Description: This script searches for the following strings
# and will substitute them with the right German Characters.
#
# \"a = <20>
# \"u = <20>
# \"o = <20>
# \"A = <20>
# \"O_ = <20>
# \"U = <20>
# \ss{} = <20>
#
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/\\"a/<2F>/g' -e 's/\\"u/<2F>/g' -e 's/\\"o/<2F>/g' \
-e 's/\\"a/<2F>/g' -e 's/\\"u/<2F>/g' -e 's/\\"o/<2F>/g' \
-e 's/\\"A/<2F>/g' -e 's/\\"U/<2F>/g' -e 's/\\"O/<2F>/g' -e 's/\\ss{}/<2F>/g' >"$G_STR"
if [ $? = 0 ]; then
mv "$G_STR" "$mfile"
else
echo "Replacing failed, don't replace original."
fi
done