in reply to writing looped programs

Of course you could always semi-side step the issue with: a cron; in perl. I'd look at -O, and running as non-root if that's an option.

--
perl -pe "s/\b;([st])/'\1/mg"