ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  The Power of mdfind
Subject:   mdfind2
Date:   2006-01-07 22:42:12
From:   schwa
Response to: mdfind2

What you're suggesting is a mdls command that takes a --xml switch. You could then use something like:


mdfind -0 'foo' | xargs -o mdls --xml


Unfortunately mdls doesn't take a --xml switch. So I'd have to write a "mdls2" command and I bet someone would complain that "too bad you decrease its usefulness and adaptability by making it a standalone replacement for mdfind".


Of course if you truly wished to harness the "flexibility and power of the command line tradition" then you could take the output of mdfind, pipe it through xargs and mdls and then through some awful sed/awk/perl abomination to convert the output of mdls into xml... I'm sure it would be extremely graceful, easy to use and easy to maintain...