cleanname prefers mv

master
TiynGER 5 years ago
parent cafcd98fa0
commit 0924d9178c

@ -10,12 +10,17 @@ do
else else
echo "renaming file $oldname to $newname" echo "renaming file $oldname to $newname"
if [ -f "$oldname" ]; then if [ -f "$oldname" ]; then
echo "using mv"
mv "$oldname" "$newname"; mv "$oldname" "$newname";
elif [ -d "$oldname" ]; then elif [ -d "$oldname" ]; then
if [ -e "$newname" ]; then
echo "using cp"
cp -r "$oldname/." "$newname" && rm -r "$oldname"; cp -r "$oldname/." "$newname" && rm -r "$oldname";
else else
echo "using mv"
mv "$oldname" "$newname"; mv "$oldname" "$newname";
fi fi
fi fi
fi fi
fi
done done

Loading…
Cancel
Save