Skip to content

Instantly share code, notes, and snippets.

@alanc
Created August 18, 2018 17:19
Show Gist options
  • Save alanc/10e918243ed06b41a9212e78dc642278 to your computer and use it in GitHub Desktop.
Save alanc/10e918243ed06b41a9212e78dc642278 to your computer and use it in GitHub Desktop.
Compare <parameter> tags listed in synopsis of SolBook man page with those in the body
mkdir /tmp/params
foreach f ( on/en/xman2/*xml on/en/xman3c/*xml )
echo "cat //synopsis/parameter" | xmllint --loaddtd --nonet --path /usr/share/xml/xsolbook \
--path /usr/share/xml/xsolbook/entities --path /usr/share/xml/xsolbook/entities/en --shell $f \
| perl -n -e 'print $1, "\n" if m{<parameter>(.*)</parameter>}' | sort -u > /tmp/params/${f:t}-syn
echo "cat //parameter" | xmllint --loaddtd --nonet --path /usr/share/xml/xsolbook --path \
/usr/share/xml/xsolbook/entities --path /usr/share/xml/xsolbook/entities/en --shell $f \
| perl -n -e 'print $1, "\n" if m{<parameter>(.*)</parameter>}' | sort -u > /tmp/params/${f:t}-all
diff -u /tmp/params/${f:t}-syn /tmp/params/${f:t}-all >> /tmp/params/diffs
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment