[linux-elitists] More crudeness and light

Rob McGee list+Elite@nodns4.us
Tue Oct 25 17:50:26 PDT 2005


On Tuesday 2005-October-25 19:09, Teh Entar-Nick wrote:
> > My crontab then just looks like this:
> > 0 3 * * *       cd ~/grabs/ && while read i < feeds; do
> > /usr/local/bin/podcast $i; done
>
> Er, here of course I thought i was being oh so clever with my
> eradication of /bin/cat where a simple < will of course do.  As
> anyone who's ever tried a < in the while section of a while loop wil
> ltell you, that "read" starts over each time, so you get infinite
> iteration over the first line of the file.  Not a recipe for success.
>
> 0 3 * * *       cd ~/grabs/ && cat feeds | while read i; do
> /usr/local/bin/podcast $i; done
>
> ...works much better.

Right idea; you just had the redirection in the wrong place. Or am I 
missing something here?

while read i ; do /usr/local/bin/podcast $i ; done < feeds
-- 
    Rob - /dev/rob0



More information about the linux-elitists mailing list