#!/bin/bash

#echo Removing trailing whitespace from $infile
fixafile(){
    infile="$1"
    outfile=/dev/shm/shitfuckpiss
    if [ ! -f "$infile" ] || [ -L $infile ] ; then
	echo USAGE: $0 infile outfile, not-f or -L $infile failed
    else
	sed -e 's/[ \t]*$//' $infile > $outfile
	mv $outfile $infile
	
    fi
}

filelist=$(ls */*.tex | grep -v -e introduction -e closing)
for names in $filelist ; do
   fixafile $names
done


# cat input.txt | sed 's/[ \t]*$//' > output.txt
