Skip to content

Instantly share code, notes, and snippets.

@nikos-glikis
Created July 23, 2016 20:11
Show Gist options
  • Save nikos-glikis/3fc818c253963b89391455fc6c6d8388 to your computer and use it in GitHub Desktop.
Save nikos-glikis/3fc818c253963b89391455fc6c6d8388 to your computer and use it in GitHub Desktop.
#repeat x times
#run 5 ls - runs ls 5 times
function run() {
number=$1
shift
for n in $(seq $number); do
$@
sleep 1
done
}
#run forever
#forever ls
forever() {
while true; do $@; sleep 2; done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment