Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: repeat count?
- X-seq: zsh-users 28643
- From: Marc Chantreux <mc@xxxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Cc: zeurkous@xxxxxxxxxxxxxxx, dominik.vogt@xxxxxx, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: repeat count?
- Date: Mon, 16 Jan 2023 20:17:11 +0100
- Archived-at: <https://zsh.org/users/28643>
- Dkim-filter: OpenDKIM Filter v2.10.3 zmtaauth02.partage.renater.fr BF4EBA0101
- In-reply-to: <CAN=4vMowP0vszuFnzXcxasnirJeXsDt5sc5p-A9wRGjU1SvoZg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <Y8WR4X/amuVc25nF@localhost> <thinkcrap!zeurkous!1673893575.30673@uucp> <CAN=4vMowP0vszuFnzXcxasnirJeXsDt5sc5p-A9wRGjU1SvoZg@mail.gmail.com>
On Mon, Jan 16, 2023 at 07:49:39PM +0100, Roman Perepelitsa wrote:
> > for a in {0..9}; do
> > echo "pass number ${a}";
> > done;
print -f 'pass number %d\n' {0..9}
# is there a way to online this ?
set -- {0..9}
print -l 'pass number '$^@
n=0; repeat 10 echo pass number $[++n]
> Be aware that this is a lot slower if you are iterating many times and
> care about the performance of the loop.
my prefered would be
seq -f 'pass number %g' 10
regards,
marc
Messages sorted by:
Reverse Date,
Date,
Thread,
Author