latex_to_ae 1.03 KB
Newer Older
Nico Schottelius's avatar
Nico Schottelius committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
# 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