I would like to output the names of files for which a command succeeds, when I expect it will fail,while suppressing the warnings. I'd prefer a one-liner.
Something along the lines of:
find xml/malformed-xml -type f -iname '*.xml' -exec if xmllint --noout --dtdvalid check-xml.dtd {} 2>/dev/null; then echo "Should have failed for {}"; fi \;
or
find xml/malformed-xml -type f -iname '*.xml' -print0 | xargs -0 -n 1 -i if xmllint --noout --dtdvalid check-xml.dtd {} 2>/dev/null ; then echo "Should have failed for {}"; fi
and so far, I am not getting much love. Suggestions?