xmllint: combine find command with xmllint command

29 Views Asked by At

I have a number of xml files in a directory. I can list them:

find . -name "*.xml" | grep "/path/to/directory/"

And then I can search for a value in individual file:

xmllint --xpath "//bundle/artifact" /path/to/directory/abc.xml

How can I do both steps in a single command, and eliminating duplicate results as well? I tried this, expecting output of first two commands would act as input to xmllint command, but doesn't work:

find . -name "*.xml" | grep "/path/to/directory/" | xmllint --xpath "//bundle/artifact"
0

There are 0 best solutions below