or file in `ls`; do echo "cp -R $dir ./dir2/"; done
This works great except directories with spaces do not work as expected. For example directory name sales and returns
cp -R /dir1/sales /dir2/
cp -R/dir1/and /dir2/
cp -R /dir1/returns /dir2/
I should get
cp -R /dir1/sales and returns /dir2/
How do I stop directory names with spaces from being split?
I'll close the question after this (-: thanks all.