Woozle Wuzzle
find, xargs and spaces

I commonly use the following (or something close to it) to rip through third-party source to find something I'm interested in:

find . -name "*.java" -type f | xargs grep someMethod

The problem that I usually run into is that directories will have spaces in the names (xargs treats spaces as delimiters). The trick to getting around this is the following:

find . -name "*.java" -type f -print0 | xargs -0 grep someMethod

The -print0 on find will use null to separate filenames and the -0 on xargs will read them. This article has more information.

And for those of you that are wondering why I have spaces in directories / filenames, A) it's 2005 people, B) I'm developing on Windows where it's more common and C) I'm looking at third-party source (i.e. go b*tch to someone else).

Developers Needed!

I am working with a small start-up that is focusing on a business-centric approach to information security. We need proven Java developers to design and build the core systems of the product.

If you have the qualities listed below (or know of someone that possesses them), send me an email.

  • Agressive and driven
  • Lives for the challenge
  • Does what it takes to get it done but understands what is needed to support it
  • Works best in very small teams
  • Understands what a "team of one working in a group of peers" entails
  • Self lead, self directed and self motivated
  • Soup-to-nuts mentality and has the experience to back it up
  • Has a clear definition of success
  • Has something to prove and needs a place to do it
  • Not looking for a "job"
  • Experience writing COTS products
Creative Commons License Unless otherwise expressly stated, all original material of whatever nature created by Rob Grzywinski and included in this weblog and any related pages, including the weblog's archives, is licensed under a Creative Commons License.