Error while running bash script that moves files
- by K.K Patel
I am new to bash scripting and want to create bash script that moves some days old files between source and destination as per days defined in script.
When I run this script I get error line 16: syntax error near unexpected token `do'
#!/bin/bash
echo "Enter Your Source Directory"
read soure
echo "Enter Your Destination Directory"
read destination
echo "Enter Days"
read days
do
find $soure -mtime +$days mv $soure $destination {} \;
echo "Files $days old moved from $soure to $destination"
done
please help me to create this script.