source: trunk/third/bash/examples/functions/repeat3 @ 12959

Revision 12959, 283 bytes checked in by tb, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r12958, which included commits to RCS files with non-trunk default branches.
Line 
1# From psamuels@jake.niar.twsu.edu (Peter Samuelson)
2# posted to usenet, Message-ID: <6rtp8j$2a0$1@jake.niar.twsu.edu>
3
4repeat ()
5{
6        local i max;     # note that you can use \$i in the command string
7        max=$1; shift;
8
9        i=1; while ((i <= max)); do
10                eval "$@"; ((i = i + 1));
11        done;
12}
Note: See TracBrowser for help on using the repository browser.