How to copy files and add prefix at the same time?

I am not familiar with osx terminal command.

I have a java project containing many package.

Some classes have same name in different package.

I need to copy all of the class files into a directory, so I need to add
corresponding package prefix on each files.

For example, I have root/com/example1/test.java and root/com/example2/test.java two classes having the same name in different packages. I need to copy them into root directory and add prefix, making them become example1.test.java and example2.test.java in root directory.

How to do this using terminal command?


Source: bash

Leave a Reply