我创建了以下脚本,将定义的旧文件从源目录移动到目标目录。它运行良好。
#!/bin/bash
echo "Enter Your Source Directory"
read soure
echo "Enter Your Destination Directory"
read destination
echo "Enter Days"
read days
find "$soure" -type f -mtime "-$days" -exec mv {} "$destination" \;
echo "Files which were $days Days old moved from $soure to $destination"
这个脚本很好地移动了文件,但它也移动了我不想要的源子目录的文件。它不应该占用子目录文件。我怎样才能做到这一点 ?