Function to repeat a command n times

This commit is contained in:
Andrew Tomaka 2016-02-05 13:52:00 -05:00
parent 4970bd2ff5
commit 3740d36994

View file

@ -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
}