|
H.J.Bathoorn wrote: Mmm interesting. Works fine on mine. I did the following testOn Wednesday 24 May 2006 03:29 pm, Neill Jones wrote:Just for info and clarity:A minor extra to H.J.Bathoorns post ... in the above, it is not the -iname which causes problems with the spaces, it is the use of xargs. For example, find . | grep "filename" works as pointed out by Harm. Also find . -iname "*.txt" | grep "filename" will work with all .txt files found. In both cases this can be understood since find returns each find item with a new line after it. grep then just reads each line of standard in which is a full line with the file name on it. When these are combined together as parameters for xarg however the spaces are seen as parameter breaks and so cause problems. Then you need to use the -print0 and xargs -0 options.Reading theman-pages one would expect so but ....... on none of my boxes do filenames with spaces get shown using -iname, either with or without print0 and/or xargs -0. Do they show up on your box or are you asuming they will? touch "a file with spaces.txt" touch "another file with spaces.txt"then ran find . -iname "*.txt"which resulted in ./a file with spaces.txt ./another file with spaces.txtand then ran find . -iname "*.txt" | grep "another"which gave me what I would expect ./another file with spaces.txtUnless I am missing something with the test, I would assume that the above was sufficient to prove it works. So perhaps we are running different versions of find? This is the version I am running ... [EMAIL PROTECTED] ~/Desktop]$ find --version GNU find version 4.2.24 Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION Regards Neill |
- Re: [newbie] Find and spaces in file names ... was oowrite... Neill Jones
- Re: [newbie] Find and spaces in file names ... was oowrite... H.J.Bathoorn
- Re: [newbie] Find and spaces in file names ... was oowrite... Duncan Anderson
- Re: [newbie] oowriter2 Lee Wiggers
- Re: [newbie] Find and spaces in file names ... was oowrite... H.J.Bathoorn
- Re: [newbie] Find and spaces in file names ... was oowrite... Duncan Anderson
- Re: [newbie] Find and spaces in file names ... was oowrite... Neill Jones
- Re: [newbie] Find and spaces in file names ... was oowrite... H.J.Bathoorn
- Re: [newbie] Find and spaces in file names ... was oowrite... Neill Jones
- Re: [newbie] Find and spaces in file names ... was oowrite... H.J.Bathoorn
- Re: [newbie] Find and spaces in file names ... was oowrite... Neill Jones
- Re: [newbie] Find and spaces in file names ... was oowrite... H.J.Bathoorn
- Re: [newbie] a test --Find and spaces in file names ... w... H.J.Bathoorn
- Re: [newbie] Find and spaces in file names ... was oowrite... Neill Jones
