#!/usr/bin/sh for i in *.tex do sed -f sedscript $i >new/$i cmp $i new/$i && rm new/$i done