How to merge entries from multiple files into 1?

Hello Friends -

I have been struggling with creating a script that can contain all session info from various instances of an application into a file

Each time I have to search, i do a lengthy grep such as this:

grepssh -P my_instance 'search_string' config/pattern/config.isi | sed G'

My question is:

Can a unix script accomplish this by grepping all the required entries and put them into a single file?

Example file on host 1:

/new/uat/appt/decap_instance1/config/insert.xml
<Name> DOF_CON</Name>
<Host> 123.1.3.5 </Host>
<Port>11234</Port>

<Name> DOF_CON2</Name>
<Host> 123.1.3.6</Host>
<Port>11235</Port>

Example file on host 2:

/new/uat/appt/decap_instance2/config/insert.xml
<Name> DOF_CON4</Name>
<Host> 123.1.3.4 </Host>
<Port>11239</Port>

Desired result in a file:

decap_instance1
DOF_CON
123.1.3.4
11239

decao_instance2
DOF_CON4
123.1.3.5
11234

and so on..

Thank you!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.