Skip to content

Commit

Permalink
feat(utility): add a do-repeat command which can be used to exec a cm…
Browse files Browse the repository at this point in the history
…d a set number of times
  • Loading branch information
Deavon M. McCaffery committed Aug 19, 2016
1 parent f95f834 commit 736035d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/scripts/do-repeat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function do-repeat() {
local count=$1
local cmd="${*:2}"

for (( current=1; current<=$count; current++ )); do $cmd; done
}

function redo() {
do-repeat $@
}

0 comments on commit 736035d

Please sign in to comment.