[PLUG] find | while read

Eric Wilhelm scratchcomputing at gmail.com
Sun Apr 13 06:50:47 UTC 2008


# from Stuart Jansen
# on Saturday 12 April 2008 23:33:

>> Alternatively, you could do it in perl with the find (git) command
>> as a piped open fork, thus the parent process still has a STDIN to
>> lend to the aspell.
>
>Which is actually what I already did a couple of days ago, but I enjoy
>pushing Bash to its limits. It never ceases to amaze me how shell
>scripting makes trivial, incorrect solutions easy and robust, correct
>solutions near impossible.

So why do you say that setting IFS freaks you out?

  IFS=$'\n'; for FILE in $(find -name '*.txt'); do aspell -c $FILE; done

Seems pretty un-freaky to me.  In fact, I'm glad you mentioned it.

--Eric
-- 
Speak softly and carry a big carrot.
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------



More information about the PLUG mailing list