I am trying to write a script using a for loop to copy files to a directory that will also echo the copy command to the terminal. I have successfully gotten the script to copy files, however, am having issues making it echo
each copy command to the terminal. For example, if it copies files a
, b
, and c
, to directory 2
, I want it to say each time it copies a file path/file copied to /path/path/directory
.
This is what I have so far:
for i in /Users/ashleyschumann/Pictures
do
cp -r ./Pictures ./BACKUP_FILES2
#echo "filename copied to BACKUP_FILES2"
#echo "$fn copied to $ashleyschumann/BACKUP_FILES2"
done
The two commented lines I have both tried and neither got the desired result. Any help would be appreciated.
cp -v
? – muru Feb 20 '20 at 7:00rsync -v
– Kusalananda♦ Feb 20 '20 at 7:34