Get xmllint to output xpath results \n-separated, for attribute selector

前端 未结 5 2016
清酒与你
清酒与你 2020-12-18 18:35

How can I get xmllint to output multiple results of xpath selector for attributes \"per line\"?

Take this example:

  

        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-18 19:14

    You can try:

    $ xmllint --shell inputfile <<< `echo 'cat /config/*/@*'`
    

    You might need to grep the output, though, so as to filter the undesired lines.

提交回复
热议问题