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-03-19 16:17:49 +00:00
|
|
|
[ -f RM ] && {
|
|
|
|
cat RM | cut -c -32 | while read line; do sed -i "/$line/d" vorhanden ; done
|
|
|
|
cat RM | cut -c 35- | while read line; do
|
|
|
|
l=$(grep " $line"$ vorhanden)
|
|
|
|
[ -n "$l" ] && {
|
|
|
|
echo $l
|
|
|
|
md5=$(echo $l | cut -c -32)
|
|
|
|
sed -i "/$md5/d" vorhanden
|
|
|
|
}
|
|
|
|
done
|
2019-03-19 16:21:53 +00:00
|
|
|
rm RM
|
2019-03-19 16:17:49 +00:00
|
|
|
}
|
|
|
|
|
2019-03-05 20:28:17 +00:00
|
|
|
#gleiche dateien anhand md5 aussortieren
|
2019-03-05 18:50:08 +00:00
|
|
|
cat vorhanden | cut -c -32 | while read line; do sed -i "/$line/d" 2cp ; 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-03-05 20:28:17 +00:00
|
|
|
cat vorhanden | cut -c 35- | while read line; do
|
2019-03-05 20:32:31 +00:00
|
|
|
l=$(grep " $line"$ 2cp | tee -a konflicts)
|
|
|
|
[ -n "$l" ] && {
|
|
|
|
echo $l
|
|
|
|
md5=$(echo $l | cut -c -32)
|
|
|
|
sed -i "/$md5/d" 2cp
|
|
|
|
}
|
2019-03-05 20:28:17 +00:00
|
|
|
done
|