cleanname now merges files

master
TiynGER 5 years ago
parent 649e4a849a
commit 22c1731349

@ -3,7 +3,14 @@
for oldname in "$@" for oldname in "$@"
do do
newname=`echo "$oldname" | tr '[:upper:]' '[:lower:]' | sed 's/\ /_/g; s/Ö/oe/g; s/Ä/ae/g; s/Ü/ue/g; s/ö/oe/g; s/ä/ae/g; s/ü/ue/g; s/ß/ss/g'`; newname=`echo "$oldname" | tr '[:upper:]' '[:lower:]' | sed 's/\ /_/g; s/Ö/oe/g; s/Ä/ae/g; s/Ü/ue/g; s/ö/oe/g; s/ä/ae/g; s/ü/ue/g; s/ß/ss/g'`;
if [[ "$oldname" != "$newname" ]]; then if [ "$oldname" != "$newname" ]; then
mv "$oldname" "$newname"; if [ -f "$newname" ]; then
echo "skipping $newname, because it already exists";
else
echo "$newname exists, copying $oldname to $newname"
rsync -a "$oldname/." "$newname"
rm -r "$oldname";
fi
fi fi
done done

Loading…
Cancel
Save