Imported from ../bash-2.03.tar.gz.
This commit is contained in:
parent
bc4cd23ce9
commit
b72432fdcc
191 changed files with 10113 additions and 3553 deletions
12
examples/functions/repeat3
Normal file
12
examples/functions/repeat3
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# From psamuels@jake.niar.twsu.edu (Peter Samuelson)
|
||||
# posted to usenet, Message-ID: <6rtp8j$2a0$1@jake.niar.twsu.edu>
|
||||
|
||||
repeat ()
|
||||
{
|
||||
local i max; # note that you can use \$i in the command string
|
||||
max=$1; shift;
|
||||
|
||||
i=1; while ((i <= max)); do
|
||||
eval "$@"; ((i = i + 1));
|
||||
done;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue