Created
May 3, 2019 09:39
-
-
Save mykeels/28ec07c3b8712a352be1d69a2a37d377 to your computer and use it in GitHub Desktop.
A shell script to repeat a command, a specified number of times
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# function run | |
run() { | |
number=$1 | |
shift | |
for i in `seq $number`; do | |
$@ | |
done | |
} | |
# usage: | |
# run <number> <script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment