[CentOS] repeat command

Matt matt.mailinglists at gmail.com
Fri May 3 21:38:30 UTC 2013


> repeat 10 some_command

Found this on the web somewhere:

#!/bin/sh
i=0
num=$1
shift
while [ $(( i += 1 )) -le $num ]; do
  eval "$@"
done

Worked fine.  Thanks.



More information about the CentOS mailing list