2019-03-05 18:50:08 +00:00
|
|
|
#!/bin/bash
|
2019-03-19 16:21:53 +00:00
|
|
|
#wenn delete file exits -> handle deletons (importand for konflict handling
|
2019-09-10 23:18:10 +00:00
|
|
|
[ -f 2rm.md5 ] && {
|
|
|
|
cat 2rm.md5 | cut -c -32 | while read line; do
|
2019-09-11 01:38:55 +00:00
|
|
|
sed -i "/$line/d" aim.md5
|
2019-09-10 23:10:25 +00:00
|
|
|
done
|
2019-09-10 23:18:10 +00:00
|
|
|
cat 2rm.md5 | cut -c 35- | while read line; do
|
2019-09-11 01:38:55 +00:00
|
|
|
l=$(grep " $line"$ aim.md5)
|
2019-03-19 16:17:49 +00:00
|
|
|
[ -n "$l" ] && {
|
|
|
|
echo $l
|
|
|
|
md5=$(echo $l | cut -c -32)
|
2019-09-11 01:38:55 +00:00
|
|
|
sed -i "/$md5/d" aim.md5
|
2019-03-19 16:17:49 +00:00
|
|
|
}
|
|
|
|
done
|
2019-09-10 23:18:10 +00:00
|
|
|
rm 2rm.md5
|
2019-03-19 16:17:49 +00:00
|
|
|
}
|
|
|
|
|
2019-03-05 20:28:17 +00:00
|
|
|
#gleiche dateien anhand md5 aussortieren
|
2019-09-11 01:38:55 +00:00
|
|
|
cat aim.md5 | cut -c -32 | while read line; do sed -i "/$line/d" 2cp.md5 ; done
|
2019-03-05 20:28:17 +00:00
|
|
|
|
|
|
|
#dateien die verschiedenen md5 haben aber bei beiden existieren als konflikte behandeln
|
2019-03-05 20:32:31 +00:00
|
|
|
echo Konflicts:
|
|
|
|
echo
|
2019-09-11 01:38:55 +00:00
|
|
|
cat aim.md5 | cut -c 35- | while read line; do
|
2019-09-10 23:18:10 +00:00
|
|
|
l=$(grep " $line"$ 2cp.md5 | tee -a konflicts)
|
2019-03-05 20:32:31 +00:00
|
|
|
[ -n "$l" ] && {
|
|
|
|
echo $l
|
|
|
|
md5=$(echo $l | cut -c -32)
|
2019-09-10 23:18:10 +00:00
|
|
|
sed -i "/$md5/d" 2cp.md5
|
2019-03-05 20:32:31 +00:00
|
|
|
}
|
2019-03-05 20:28:17 +00:00
|
|
|
done
|