#!/bin/bash BASE=`basename $0` rm $BASE.* TMP=$BASE.$$ for i in `cat worte.txt` do i1=`echo $i|tr [:upper:] [:lower:]` i2=`echo $i1|sed -e"s+Ä+a+g"` echo $i2|grep "[0-9]" if [ ! "$?" = "0" ] ; then echo $i $i2 >> $TMP.1 else p1=`echo $i2|sed -e"s+[0-9].*++g"` p2=`echo $i2|sed -e"s+[a-z]*++g"` p3=`echo $i2|sed -e"s+.*[0-9]++g"` echo $i $p1 $p2 $p3|awk '{printf("%s %s%04d%s\n", $1, $2 ,$3 ,$4 );}' >> $TMP.1 fi done sort -k2 < $TMP.1 |awk '{print $1}' > sortiert.txt diff sortiert.txt sortiert_soll.txt if [ "$?" = "0" ] ; then touch fertig fi