in reply to mv files from dir1 to dir2

I am not exactly replying to your problem, but recently I found that system(mv ..) couldn't give proper return status, if we would have IGNORED the CHLD signal or improper signal handler set for CHLD.
This is because system(mv) generally forks a process and system function depends on CHLD signal internally to provide us the return status. If we ignore SIGCHLD we won't get proper return value from system function.
I have put this in interest of beginner monks.