[PLUG] find | while read

Stuart Jansen sjansen at buscaluz.org
Sun Apr 13 05:26:57 UTC 2008


On Sat, 2008-04-12 at 23:47 -0500, Robert Citek wrote:
> Can you provide a test case which produces the error you are observing
> and what the desired output should look like?

Uhm... I already did but you snipped it out in your reply. At the risk
of sounding like a jerk while I'm still coming out of lurker mode, I
assumed everyone would be able to create there own files with misspelled
words.

echo "Thiss is mispeled." > foo.txt
echo "I luv spel checkurs." > bar.txt

If you actually ran the broken screen, you'd noticed that either (a)
aspell just dies or (b) aspell launches but a partial filename ends up
somewhere on the screen and aspell responds erratically to key presses
(like something else is stealing data from stdin).

I haven't yet established my reputation, so I don't expect everyone to
realize I'm already quite experienced with shell scripting. Perhaps I
should have done more to make it clear that I'm not looking for hand
holding. I'm looking for novel solutions to the problem of looping over
output produced by an arbitrary program and assigned each line to a
variable. Any solution must be able to handle output containing
whitespace without corrupting it. I would also prefer to be able to call
functions instead of resorting to helper scripts.




More information about the PLUG mailing list