|
|
@ -10,11 +10,16 @@ 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
|
|
|
|
cp -r "$oldname/." "$newname" && rm -r "$oldname";
|
|
|
|
if [ -e "$newname" ]; then
|
|
|
|
else
|
|
|
|
echo "using cp"
|
|
|
|
mv "$oldname" "$newname";
|
|
|
|
cp -r "$oldname/." "$newname" && rm -r "$oldname";
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
echo "using mv"
|
|
|
|
|
|
|
|
mv "$oldname" "$newname";
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|