Shell Script to copy and number files
Hi!
I need to copy several files from a directory tree. Inside this tree there are several files with the same name, and I have to copy them altogether to the same directory. This is an example of how it looks \tmp\a \tmp\a\1.txt \tmp\a\2.txt \tmp\a\3.txt \tmp\b \tmp\b\1.txt \tmp\b\3.txt \tmp\b\4.txt \tmp\c \tmp\c\5.txt \tmp\c\2.txt Now I want to copy the files to \tmp\dest1\ as 1.txt, 2.txt .. 8.txt - numbered no matter how they are originally named. I just want to keep the original file extension (that may differ). How do I realize that? Thank you in advance! |
If you absolutely don't care about the original file name, then you can do something like this:
Code:
declare -i I=1 |
All times are GMT -5. The time now is 10:54 PM. |