xmlスニペットは次のとおりです。
$ cat short.xml
<hostnames>
<hostname name="yahoo.com" type="user"/>
<hostname name="ir1.fp.vip.sp2.yahoo.com" type="PTR"/>
</hostnames>
<hostnames>
<hostname name="Inc.com" type="user"/>
<hostname name="www.inc.com" type="PTR"/>
</hostnames>
必要な出力は次のとおりです。
yahoo.com | ir1.fp.vip.sp2.yahoo.com
Inc.com | www.inc.com
これまでのところ、部分的にしか機能していないもの:$ xml sel -t -m "// hostname" -v "@name" -n short.xml
Type=条件を適切にトラップできないようです。TIA。