in reply to Re^3: Copying files from one directory to another with different subdir
in thread Copying files from one directory to another with different subdir

sure... so the source directory is like :
/proj/tool/STAGE/<ENV>/<CLIENT>/*.xml and the target dir is like:
/proj/tool/PROD/<ENV>/<CLIENT> Where in both cases the <ENV> can be something like: Env A,Env B and so on and Client can be Client A and Client B and so on. but ideally the script should be able to copy files from source to target. something like :
cp /proj/tool/STAGE/EnvA/ClientA/*.xml /proj/tool/PROD/EnvA/ClientA
cp /proj/tool/STAGE/EnvA/ClientB/*.xml /proj/tool/PROD/EnvA/ClientB
cp /proj/tool/STAGE/EnvB/ClientC/*.xml /proj/tool/PROD/EnvB/ClientC
Let me know if more information is needed.
  • Comment on Re^4: Copying files from one directory to another with different subdir

Replies are listed 'Best First'.
Re^5: Copying files from one directory to another with different subdir
by Corion (Patriarch) on Sep 19, 2016 at 14:15 UTC

    In which part would, for example, File::Copy::Recursive fail? Just call it for (say) /proj/tool/STAGE/EnvA/ClientA/ to /proj/tool/PROD/EnvA/ClientA/ and so on.

    Also see glob and readdir, where glob is the much better approach.