Function to repeat a command n times
This commit is contained in:
parent
4970bd2ff5
commit
3740d36994
1 changed files with 12 additions and 0 deletions
12
functions
12
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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue