I need a UNIX cp command
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
My goal is to copy files from many directories to one sigle directory. Here is what I type: cp `find /usr/prod -name "*.4gl"` /usr/prod/source & cp `find /usr/prod -name "*.ace"` /usr/prod/source & cp `find /usr/prod -name "*.per"` /usr/prod/source & Everything is now in the source directory. So far so good. My problem has to do with files in different directories with the same name. Let us say there are 2 files: /usr/prod/help.4gl and /usr/prod/xyz/help.4gl. The UNIX cp command will first copy /usr/prod/help.4gl in /usr/prod/source. It then will cp /usr/prod/xyz/help.4gl in /usr/prod/source and overwrite the first version of help.4gl. I do not want this. I do not know which help.4gl is valid yet. What can I do? It would be great if there is a copy command or a script algorithm that will denote the second & subsequent files by its basename.version#. Has anyone written code with similar functionality before I "...re-invent the wheel" ? Sent via Deja.com http://www.deja.com/ Before you buy.