You have to adjust your logic.
You are not testing the entries to copy for being directories.
You have one -d test, but that is done on the "constant" (i.e. never changed) $newDir.
In reply to Re: copy files and directories recursively
by pKai
in thread copy files and directories recursively
by aloknath521
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |