32 lines
836 B
Bash
Executable File
32 lines
836 B
Bash
Executable File
#!/bin/bash
|
|
#wenn delete file exits -> handle deletons (importand for konflict handling
|
|
[ -f 2rm.md5 ] && {
|
|
cat 2rm.md5 | cut -c -32 | while read line; do
|
|
sed -i "/$line/d" aim.md5
|
|
done
|
|
cat 2rm.md5 | cut -c 35- | while read line; do
|
|
l=$(grep " $line"$ aim.md5)
|
|
[ -n "$l" ] && {
|
|
echo $l
|
|
md5=$(echo $l | cut -c -32)
|
|
sed -i "/$md5/d" aim.md5
|
|
}
|
|
done
|
|
rm 2rm.md5
|
|
}
|
|
|
|
#gleiche dateien anhand md5 aussortieren
|
|
cat aim.md5 | cut -c -32 | while read line; do sed -i "/$line/d" 2cp.md5 ; done
|
|
|
|
#dateien die verschiedenen md5 haben aber bei beiden existieren als konflikte behandeln
|
|
echo Konflicts:
|
|
echo
|
|
cat aim.md5 | cut -c 35- | while read line; do
|
|
l=$(grep " $line"$ 2cp.md5 | tee -a konflicts)
|
|
[ -n "$l" ] && {
|
|
echo $l
|
|
md5=$(echo $l | cut -c -32)
|
|
sed -i "/$md5/d" 2cp.md5
|
|
}
|
|
done
|