repo.or.cz
/
bash.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Patch-ID: bash40-021
[bash.git]
/
examples
/
functions
/
repeat3
blob
65048bf912767e10ba847b4bed075255f94104b0
1
# From psamuels@jake.niar.twsu.edu (Peter Samuelson)
2
# posted to usenet, Message-ID: <6rtp8j$2a0$1@jake.niar.twsu.edu>
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
}