Linux/Unix script for file pattern matching
Hello all,
In my project I have some entities and files corresponding to them. I need to copy each {Entity} file to a directory named {entity-dir}. A small example is:
<pre>
for entities: xxxxData_Itemxxxx.xml
xxxxData_ItemBomxxxx.xml
xxxxData_Procxxxx.xml
xxxxData_ProcDefxxxx.xml
to the directories
item
itembom
proc
procdef
</pre>
I was able to copy the files but there is a small problem with file-name pattern matching. When I search the pattern, let's say, for 'Item', it copies the file name xxxxData_Itemxxx.xml and xxxData_ItemBomxxxx.xml in the same directories, but I want them to go to different dirs.
Also the order is important,
(xxxx here is any characters that can appear before and after the entity name).
Please help me with pattern-matching.
Thanks & Regards,
Varun Narang
|