#!/bin/bash #name="\/home\/tbretz\/eDonkey2000\/incoming\/O\/MonikaDieMieterin.tex" #`echo $1 | sed s/\\\ /\\\\\\\ /` #| sed s/\ /\\\\\ /g` # echo \!: Enter terse mode (less output) # echo ~$2: Determin run mode by externsion of file name # cat "$1": Print file content to standard output # sed: Add a ^ in front of all lines to tell ispell to check the line # remove % sign if talking to ispell by %@ or %*, add an # additional new line to make the line counter work, # remove comments starting with %> from output (if it # is at linestart an empty line is send instead) and # remove \nospell{...} # remove "\begin{figure}[.*]" # ispell: Perform ispell run # myspell.sed: Convert ispell ouput to output readable by fte # sed: Prefix each line with the filename (necessary for fte) # Filename splitting: basename #(echo \!; echo ~$2; cat "$1" | sed -e s/^\\\(.*\\\)$/^\\1/ -e s/^^%\\\([@*]\\\)\ */\\n\\1/ -e s/[^\\]%\>.*$// -e s/\\\\nospell{.*}// ) #( echo \!; echo ~$2; cat "$1" | sed -e s/^\\\(.*\\\)$/^\\1/ -e s/^^%\\\([@*]\\\)\ */\\n\\1/ -e s/[^\\]%\>.*$// -e s/\\\\nospell{.*}// ) | ispell -a -C -S -w -d $3 | myspell.sed | sed s/^\\\(.*\\\)$/$2:\\1/ #( echo \!; echo ~$2; cat "$1" | sed -e s/^\\\(.*\\\)$/^\\1/ -e s/^^%\\\([@*]\\\)\ */^\\n\\1/ -e s/\\\([^\\]\\\)%\>.*$/\\1/ -e s/\\\\nospell{.*}// -e s/\\\\begin{[^{}]\\+}\[[htpb]*\]// -e s/[^+[:alpha:][:digit:]][[:digit:]]\\+[^+[:alpha:][:digit:]]/\ /g) | ispell -a -C -S -w+0123456789 -d $3 | myspell.sed | sed s/^\\\(.*\\\)$/$2:\\1/ #( echo \!; echo ~$2; cat "$1" | sed -e s/^\\\(.*\\\)$/^\\1/ -e s/^^%\\\([@*]\\\)\ */^\\n\\1/ -e s/\\\([^\\]\\\)%\>.*$/\\1/ -e s/\\\\nospell{.*}// -e s/\\\\begin{[^{}]\\+}\[[htpb]*\]// -e s/[^+[:alpha:][:digit:]][[:digit:]]\\+[^+[:alpha:][:digit:]]/\ /g -e s/http:\\/\\/[[:graph:]]\\+//g ) | ispell -a -C -S -d $3 | myspell.sed | sed s/^\\\(.*\\\)$/$2:\\1/ ( echo \!; echo ~$1; cat "$1" | myspell1.sed ) | ispell -a -C -S -d $2 | myspell2.sed | sed s/^\\\(.*\\\)$/"$1":\\1/