[PLUG] find | while read
Stuart Jansen
sjansen at buscaluz.org
Sun Apr 13 07:14:05 UTC 2008
On Sat, 2008-04-12 at 23:50 -0700, Eric Wilhelm wrote:
> 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.
I've done it in trivial scripts and small inner loops, but because its a
pretty low-level setting and I don't yet fully understand the effects of
changing it, I tend to fear it. Instinct tells me that modifying $IFS in
anything other than trivial scripts is just asking for trouble, but
maybe that isn't true if you know how to manage the consequences.
Have you written any non-trival scripts that modify $IFS? Are you
familiar with the side effects of changing it, and can you give advice
on how to control them?
More information about the PLUG
mailing list