You're trading efficiency for reliability and/or time. Cron will happily make sure your program runs, it logs any problems, and it is the 'standard'.

IOW your small gain in efficiency will cost you time to develop (logging, rewriting for loop, debugging). Then it will cost your company when you leave and someone has to figure out what job is running after he/she has already looked in the crontab.

Is this program causing a problem? Have you done 'ps' or 'top' on it? Is it using too much memory? These are questions you should ask before you take something out of cron.

Don't reinvent good wheels

grep
grep> chown linux:users /world

In reply to Re: writing looped programs by grep
in thread writing looped programs by tachekent

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.