There may be a builtin to do this, but here is a function you can stick in your .bashrc. Usage: repeat N COMMAND COMMAND-ARGS
. This will run COMMAND with COMMAND-ARGS, N times. Note that the quoting might be messy. I find this handy for running simple test scripts in a loop.
function repeat()
{
count=$1
shift
if [ x$count = x ]
then
count=10
fi
n=0
while [ $n != $count ]
do
eval $*
n=`expr $n + 1`
done
}