From 3740d36994be3b6b37df4bb4ab153e3477acea55 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Fri, 5 Feb 2016 13:52:00 -0500 Subject: [PATCH] Function to repeat a command n times --- functions | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/functions b/functions index dfa7f54..e0063c4 100644 --- a/functions +++ b/functions @@ -38,3 +38,15 @@ function git-date-added { git log --format=%aD $1 | tail -1 fi } + +function run { + if [ $# -lt 2 ]; then + echo Usage: run NUMBER COMMAND + else + number=$1; shift + + for i in `seq $number`; do + $@ + done + fi +}