1 2 3
#!/bin/sh # Select text value of an XML element mathing given XPath expression ./xmlstarlet sel -T -t -m "/xml/table/rec[@id='2']" -v numField --nl xml/table.xml