diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-03-23 08:04:10 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-03-23 08:04:10 +0200 |
commit | 4b05862b26330e28f0f2354c57fa5feeb0ee22e2 (patch) | |
tree | e9577a29a2a277efe58d26af746ce67c367a03ed /repeat | |
parent | 247d61da1baa2b2d1bbbc5eafa2b47a2e261d589 (diff) | |
download | extrautils-4b05862b26330e28f0f2354c57fa5feeb0ee22e2.tar.gz |
feat: add new script, "repeat"
Diffstat (limited to 'repeat')
-rwxr-xr-x | repeat | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -0,0 +1,12 @@ +#!/bin/bash + +set -eu -o pipefail + +n="$1" +shift + +i=0 +while [ "$i" -lt "$n" ] && "$@" +do + i=$(( "$i" + 1 )) +done |