Find XML files non containing a specific comment from shell

前端 未结 2 921
梦如初夏
梦如初夏 2021-01-29 03:27

I want to search (awk/grep/sed) into few XML files (pom.xml file) skipping some folder. Moreover,the first condition is that they must contain the tag

2条回答
  •  -上瘾入骨i
    2021-01-29 04:00

    You can use xmllint to search for a node using xpath

    xmllint --xpath '//module' */pom.xml
    

    Its return codes can tell you when it was found (0) or not (!= 0).

提交回复
热议问题