I am using this script to mv all the files from a shared directory to another directory:
cd /share
while :
do
for allfiles in $(find /share/ -maxdepth 1 -type f -iname "*" -mmin +1);
do
sudo mv "$allfiles" /schoolstore/
done
sleep 15s
done
But, I get error when a filen contains a space within its name, where can I fix the script to get it to work for all files name?