#!/bin/sh BASE=data find $BASE -type f -exec md5sum {} \; > liste.txt sort liste.txt > liste.txt.sort rm -f mygleiche.* N=1 F=`head -1 liste.txt.sort | cut -d' ' -f1` while read LINE; do A1=`echo $LINE | cut -d' ' -f1` A2=`echo $LINE | cut -d' ' -f2` if [ "${A1}" == "${F}" ]; then echo "$A2 " >> mygleiche.${N} else let N=N+1 echo "$A2 " >> mygleiche.${N} fi F="$A1" done < liste.txt.sort for i in mygleiche.*; do LLL=`cat $i | wc -l ` if [ $LLL -gt 1 ]; then sort -n $i > $i.s while read LINE2; do echo -n "$LINE2 " >> mygleiche.alle done < $i.s echo >> mygleiche.alle fi done sort mygleiche.alle | sed -e "s/ $//" > gleiche.out