[wplug] Handling spaces in file names

Embery, Nathan Nathan.Embery at crowncastle.com
Fri Nov 19 15:04:35 EST 2004


Maybe something like this?

  find . -name '*java' | xargs -i{} wc {} 

Nate

-----Original Message-----
From: wplug-bounces+nathan.embery=crowncastle.com at wplug.org
[mailto:wplug-bounces+nathan.embery=crowncastle.com at wplug.org] On Behalf Of
J Aaron Farr
Sent: Friday, November 19, 2004 2:24 PM
To: wplug at wplug.org
Subject: [wplug] Handling spaces in file names

Hello all.

Simple UNIX scripting question:

I want to do this:

  wc `find . -name *.java`

on a large repository to get total number of lines of code.  But some of
the files or directories have spaces which 'wc' doesn't like.  So, do I
have to write up a script to do this or is there some way I can get 'find'
to print the file names with the spaces escaped?  (ie- "My\ Documents"
instead of "My Documents")

Thanks for any suggestions.
jaaron
_______________________________________________
wplug mailing list
wplug at wplug.org
http://www.wplug.org/mailman/listinfo/wplug


More information about the wplug mailing list