1 2 3
#!/bin/sh # Count all nodes in XML document ./xmlstarlet sel -T -t -f -o " " -v "count(//node())" --nl xml/table.xml xml/tab-obj.xml