nsbin/latex_to_ae
Nico Schottelius d3c6e29902 Initial commit
2006-07-20 09:54:37 +02:00

45 lines
1 KiB
Text
Executable file

# 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 = ä
# \"u = ü
# \"o = ö
# \"A = Ä
# \"O_ = Ö
# \"U = Ü
# \ss{} = ß
#
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/ä/g' -e 's/\\"u/ü/g' -e 's/\\"o/ö/g' \
-e 's/\\"a/ä/g' -e 's/\\"u/ü/g' -e 's/\\"o/ö/g' \
-e 's/\\"A/Ä/g' -e 's/\\"U/Ü/g' -e 's/\\"O/Ö/g' -e 's/\\ss{}/ß/g' >"$G_STR"
if [ $? = 0 ]; then
mv "$G_STR" "$mfile"
else
echo "Replacing failed, don't replace original."
fi
done