The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 07-10-2009
bhagirathi bhagirathi is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 10
i did the same
Code:
awk '{ if (  $0 ~ /<cisco:cpt> | <cisco:sptp>/  )  {i++} if ( $0 ~ /<\/cisco:name>/ ) {print  "cpt=" i;i=0}}' test.xml
But the result added . so could you suggest how can it will print that differently
like
cpt= 1
sptp=2