Here is the code:
#!/usr/bin/perl --
use strict;use warnings;use diagnostics;use Fatal qw/:void open close/;#first find the .xml files in the directory recursively and store in a temp list
$f=`find . -name "*.xml" > /tmp/fileList`;
open TEMPFILE, "/tmp/fileList" ;
$subflowCount = 0;
# traverse throygh each xml file
while(){
$file = $_;
#if yes then look for subflow tag
$result=`grep -i " " $file`; if ( $result=~m/ /){
print $file."\n";
$subflowCount = $subflowCount + 1;
}
}
print "Total subflows are:";
print $subflowCount;
I have commented the code to understand what it is doing.
To run go to linux box:
do: chmod 777
do ./