source:
vendor/bash/3.1/examples/functions/repeat3
| Last change on this file was 3228, checked in by , 19 years ago | |
|---|---|
| File size: 283 bytes | |
| Rev | Line | |
|---|---|---|
| [3228] | 1 | # From [email protected] (Peter Samuelson) |
| 2 | # posted to usenet, Message-ID: <[email protected]> | |
| 3 | ||
| 4 | repeat () | |
| 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.
