On Tuesday, 23 May 2006 11:50, Neill Jones wrote:
> > n Tuesday 23 May 2006 09:17 am, Duncan Anderson wrote:
> >>  No problem. I like the mosquito/sledgehammer analogy. Tell me, do you
> >> know how to overcome the problem of file names being rejected by find
> >> when they contain spaces, etc.?
> >
> > No never had any of those probs, I think. What exactly do you mean?
> > All files including the ones with spaces show up.
> ><snip>
>
> I'll second that - just tried find on a set of files with spaces in
> their names and it finds
> them with no problems. If you want to pipe these through to other
> programs, you can
> use the -print0 (that's print and a zero) option which ends each file
> with a null rather
> than a newline (see man find). Then you can use xargs -0 to read them
> in. So you could
> do something like
>
> find . -iname "*.*" -print0 | xargs -0 grep -i "searchitem"
>
> to find searchitem within a set of files with spaces. (The -i's mean
> case insensitive)
>
> Neill

Thanks for that. I think I was probably thinking of "xargs" when I mentioned 
the problems I was having with "find" and names containing spaces. I normally 
use the two in conjunction with one another...

Where I seem to pick up problems with "find" on its own is when a file name 
contains a single quote "'".

cheers
Duncan
Send instant messages to your online friends http://uk.messenger.yahoo.com 
____________________________________________________
Want to buy your Pack or Services from Mandriva? 
Go to http://store.mandriva.com
Join the Club : http://www.mandrivaclub.com
____________________________________________________

Reply via email to