summaryrefslogtreecommitdiff
path: root/repeat
blob: afe3b921b8acbec95e1d22a18ecc91c946a3eb68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

set -eu -o pipefail

n="$1"
shift

i=0
while [ "$i" -lt "$n" ] && "$@"
do
    i=$(( "$i" + 1 ))
done