Skip to content

Instantly share code, notes, and snippets.

@potix2
Created January 18, 2013 02:55
Show Gist options
  • Save potix2/4562014 to your computer and use it in GitHub Desktop.
Save potix2/4562014 to your computer and use it in GitHub Desktop.
repeatedly execute commands
#!/bin/sh
#example:
#
#$repeat 3 echo 'hoge'
#hoge
#hoge
#hoge
N=$1
shift
while [ $(( N -= 1)) -ge 0 ]
do
"$@"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment