Examples of shell loops from the command line. Note that this technique is a ksh/bash/zsh kind of thing. Tested specifically under bash, seems to apply to other reasonable ksh's though.
$ for D in bin src local ; do > cp -R /usr/$D /usr/$D.bkp > done
...or...
$ for D in bin src local; do cp -R /usr/$D /usr/$D.bkp; done
$ while : ; do > echo "==" > date > ls -la *tgz > sleep 5 > done
...or...
$ while :; do echo "=="; date; ls -la .procmailrc; sleep 5; done