[Discuss] cygwin problem

pw p.willis at telus.net
Wed Apr 16 15:42:53 PDT 2008


Noel Burton-Krahn wrote:
> There are a couple of traps here:
> 
>   for FIL in `find -iname '$DOC_TYPE'`; do
> 
> 1. the single-quotes around '$DOC_TYPE' will prevent it from expanding
> 
> 2. this causes bash to buffer the whole output of find, then split it.
>  The pipe below will work for huge directory listings
> 
> I'd try this instead:
> 
>   find "$DIR" -iname "$DOC_TYPE" | while read FIL; do
> 
> 
> ~Noel

Thanks Noel,

That did the trick.
Using 'while read' instead of 'for' works.

The system still buffers the complete file list before
iterating the output.(?)

Anyway, it works now.
Thanks again.

Peter


More information about the Discuss mailing list