I have a script which can take one file name at a time and I want to run it for many files in a folder. So, I want to pipe the output of:
find . -iname '*.m'
to my script but one line at a time.
You are looking for xargs.
find . -iname '*.m' | xargs yourscript
xargs reads items from the standard input, delimited by blanks or newlines, and executes the command (default is /bin/echo) one or more times with any initial-arguments followed by items read from standard input.