for i in `find *` breakdown since the directory name has space

hey, somebody can help me on this broken script?

for i in `find . -name index.html`;do
echo "$i"
awk '{print $0}' $i
done

the path to index.html has space in it. For example,
./10 October/index.html

then echo "$i" will gives two lines instead of one:
./10
October/index.html

how do I quota the `find ` properly? thanks!

One way

find . -name index.html | while read FILENAME
do
      echo "${FILENAME}"
done

thanks! works like a charm. for i in 'find ...' is so commonly seen as an example, it seems I should always use the while statement in future.

by the way, "man read", "man while" didn't give me manual of "read", though intuitively it is quite understandable, I would like to see the manual for learning. please give me a reference. thanks.

man ksh

See: while list do list done

In this case the input list is coming from a shell read of the pipe (i.e. the output from find). Shell read is also described in "man ksh".

Expanding a long list of files in a "for" command can produce a syntax error because the command line gets too long. My example works with any number of files.