bin/68062: standalone repeat(1) command

Jilles Tjoelker jilles at
Sun Apr 25 21:20:06 UTC 2010

The following reply was made to PR bin/68062; it has been noted by GNATS.

From: Jilles Tjoelker <jilles at>
To: bug-followup at, cyrille.lefevre at
Subject: Re: bin/68062: standalone repeat(1) command
Date: Sun, 25 Apr 2010 23:18:13 +0200

 I'm not sure if we want this repeat(1) command, given that csh(1)
 already has it as a builtin and a simple shell function can do it in
 repeat() {
         local i="$1"
         while [ "$i" -gt 0 ]; do
 This shell function will cause expansions and redirections to be
 evaluated exactly once, but so do the csh builtin and your proposed
 external command.
 The closest to the repeat command that fits in sh's model is
 ksh93/bash/zsh's arithmetic for command, e.g.
   for ((i=0; i<3; i++)); do sync; done
 I usually use the arithmetic for command or loops like in the shell
 function above.
 zsh also has a repeat compound command much like csh, except that it
 will evaluate expansions and redirections for each execution of the
 Jilles Tjoelker

More information about the freebsd-bugs mailing list