Skip to content

Instantly share code, notes, and snippets.

@mykeels
Created May 3, 2019 09:39
Show Gist options
  • Save mykeels/28ec07c3b8712a352be1d69a2a37d377 to your computer and use it in GitHub Desktop.
Save mykeels/28ec07c3b8712a352be1d69a2a37d377 to your computer and use it in GitHub Desktop.
A shell script to repeat a command, a specified number of times
# 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