summaryrefslogtreecommitdiffstats
path: root/lrm/test/testcases/xmllint.sh
blob: f61288c7cef4656817b68367e9fc59137f2be2b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

gawk -v many="$1" '
BEGIN{XMLLINT="xmllint --noout -";}
function chkoutput(ra) {
	if( ra=="" ) return;
	if( close(XMLLINT) ) # we need gawk for this
		print "xmllint reported error in RA:",ra;
}
many=="many" && /^[a-zA-Z][^:]*:[a-zA-Z0-9]+$/ {
	chkoutput(ra);
	ra=$0;
	next;
}
{ print | XMLLINT }
END{
	if( many!="many" )
		chkoutput("noname");
}
'